Object Linking and Embedding (OLE) : Using OLE custom controls (OCXs) : Implementing an ambient-property handler

Implementing an ambient-property handler
Ambient properties are used by a container to give an OCX information about its surroundings, such as the background color of a form, the current font, or the locale ID of the container's user interface.
Each ambient property is identified by a unique DISPID, which an OCX uses to specify which ambient property it wants from its container. To support the integration of OCXs with containers, OLE defines a set of standard ambient-property DISPIDs. This set is encoded into the Smalltalk pool dictionary PlatformConstants as follows:
Ambient-property handlers are implemented as methods that take a single parameter, which is the DISPID of the ambient property being requested by the OCX. OCXs may not request all possible ambient properties but only those they are interested in. Likewise, a container may not necessarily be able to respond to all ambient property requests. The ambient property handler answers the value of the requested property if it can; otherwise, it answers a nil value to inform the OCX that the property is not available. For example, the ambient-property-handler method dispidAmbientPropertyAt: in the above example might be implemented as follows:
dispidAmbientPropertyAt: dispid
"Private - Handle ambient properties."
DispidAmbientShowgrabhandles == dispid ifTrue: ^false].
DispidAmbientShowhatching == dispid ifTrue: ^false].
DispidAmbientLocaleid == dispid ifTrue: ^LocaleUserDefault].
DispidAmbientUidead == dispid ifTrue: ^false].
DispidAmbientUsermode == dispid ifTrue: ^false].
^nil
Here, the constant LocaleUserDefault comes from the pool dictionary PlatformConstants.
Note:
A class that implements OLE-container behavior should declare PlatformConstants as pool dictionaries.