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. There are four utility functions:
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. Long is used to pass values to external functions |
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 |
boolean Maxed |
|
1 |
Maxed = IsZoomed(Handle(parent)) |
|
1 |
if Maxed then sle_output.Text = "Is maxed" |
|
1 |
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 |
// Declare loop counter and handle to window object |
|
1 |
int nLoop |
|
1 |
uint hWnd |
|
1 |
// Get the handle to the PowerBuilder window. |
|
1 |
hWnd = handle(This) |
|
1 |
// Make the title bar inactive. |
|
1 |
FlashWindow (hWnd, TRUE) |
|
1 |
//Wait ... |
|
1 |
For nLoop = 1 to 300 |
|
1 |
Next |
|
1 |
// Return the title bar to its active color. |
|
1 |
FlashWindow (hWnd, FALSE) |
A collection of techniques for building distributed applications
with PowerBuilder.
PowerBuilder Enterprise edition only The distributed computing capabilities available with PowerBuilder
are supported in the Enterprise edition only.