The utility functions provide a way to obtain and pass Windows information to external functions and can be used as arguments in the PowerScript Send function. There are four utility functions.
Function |
Return value |
Purpose |
---|---|---|
Handle |
UnsignedInt |
Returns the handle to a specified object. |
IntHigh |
UnsignedInt |
Returns the high word of the specified long value. IntHigh is used to decode Windows values returned by external functions or the LongParm attribute of the Message object. |
IntLow |
UnsignedInt |
Returns the low word of the specified long value. IntLow is used to decode Windows values returned by external functions or the LongParm attribute of the Message object. |
Long |
Long |
Combines the low word and high word into a long. The Long function is used to pass values to external functions. |
This script uses the external function CreateWindowEx to create a child window that displays a calendar. The Handle function is used to pass the handle to the parent window of the window being created:
// Instance variable: ulong g_hwndCal g_hwndCal = CreateWindowEx( 0, ClassName, "", & WS_BORDER + WS_CHILD + WS_VISIBLE, & 0,0,0,0, & Handle(this), 0, 0, 0 )