Using utility functions to manage information
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. The following table describes the PowerScript
utility functions.
Five utility functions
|
Function |
Return value |
Purpose |
|---|---|---|
|
Handle |
UnsignedInt |
Returns the handle to a specified |
|
IntHigh |
UnsignedInt |
Returns the high word of the specified Long IntHigh is used to decode Windows values |
|
IntLow |
UnsignedInt |
Returns the low word of the specified Long IntLow is used to decode Windows values |
|
Long |
Long |
Combines the low word and high word into a The Long function is used to pass values to |
|
LongLong |
LongLong |
Combines the low word and high word into a The LongLong function is used to pass values |
Examples
This script uses the external function IsZoomed to test whether the
current window is maximized. It uses the Handle function to pass a window
handle to IsZoomed. It then displays the result in a SingleLineEdit named
sle_output:
|
1 2 3 4 |
boolean Maxed Maxed = IsZoomed(Handle(parent)) if Maxed then sle_output.Text = "Is maxed" if not Maxed then sle_output.Text = "Is normal" |
This script passes the handle of a window object to the external
function FlashWindow to change the title bar of a window to inactive and
then active:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
// Declare loop counter and handle to window object int nLoop uint hWnd // Get the handle to the PowerBuilder window. hWnd = handle(This) // Make the title bar inactive. FlashWindow (hWnd, TRUE) //Wait ... For nLoop = 1 to 300 Next // Return the title bar to its active color. FlashWindow (hWnd, FALSE) |