Window Control


Events: none

---------------------------------------------------------------
Actions:

Window Messages:
-----------------

WinCtrl( <MessageID>, <hWnd>, <WParam>, <LParam> )

Example for WM_QUIT:
h = WinCtrl( "GET_FOREGROUND" )
WinCtrl( 0x0012, h, 0, 0 )

You also may specify the following messages:
"WM_SETFOCUS"
"WM_ENABLE"
"WM_SETTEXT"
"WM_CLOSE"
"WM_QUIT"
"WM_SHOWWINDOW"
"WM_COMMAND"
"WM_SYSCOMMAND"
"WM_KEYDOWN"
"WM_KEYUP"
"WM_CHAR"
"WM_SYSKEYDOWN"
"WM_SYSKEYUP"
"WM_SYSCHAR"
"WM_HSCROLL"
"WM_VSCROLL"

"BM_CLICK"
"BM_GETCHECK"
"BM_SETCHECK"

"CB_GETCOUNT"
"CB_GETCURSEL"
"CB_SETCURSEL"

"WM_LBUTTONDOWN"
"WM_LBUTTONUP"
"WM_LBUTTONDBLCLK"
"WM_RBUTTONDOWN"
"WM_RBUTTONUP"
"WM_RBUTTONDBLCLK"

Examples:
h = WinCtrl( "GET_FOREGROUND" )
WinCtrl( "WM_SETTEXT", h, 0, "New window text" )
WinCtrl( "WM_QUIT", h, 0, 0 )

Simulate menu command:
WinCtrl( "WM_COMMAND", h, id, 0 )

Note: ID can be found in resource of controlled application
See Resource tuner (www.restuner.com)


Notification:
-------------

WinCtrl( "CBN_SELCHANGE", <dialog_handle> , <control_id> )

WinCtrl( "BN_CLICKED", <dialog_handle> , <control_id> )
It is equivalent:

ch = WinCtrl( "GETDLGITEM", dh, id )
WinCtrl( "WM_COMMAND", dh, id, ch )

Note:
dh = dialog handle
id = identifier of button


Commands:
---------

WinCtrl( <command> [, <handle> [, <param1> [, <param2>]]] )


<variable> = WinCtrl( "GET_FOREGROUND" )
- returns handle of foreground window

<variable> = WinCtrl( "GET_DESKTOP" )
- returns handle of desktop window

<variable> = WinCtrl( "GETDLGITEM", <dialog_handle>, <control_ID> )
- retrieves a handle to a control in the specified dialog box

<variable> = WinCtrl( "ISACTIVE", <handle> )
- returns 1 if window is active, else 0

<variable> = WinCtrl( "ISVISIBLE", <handle> )
- returns 1 if window is visible, else 0

WinCtrl( "REMOVE_CAPTION", <handle> )

WinCtrl( "HIDE", <handle> )
WinCtrl( "ACTIVATE", <handle> )
WinCtrl( "MAXIMIZE", <handle> )
WinCtrl( "MINIMIZE", <handle> )
WinCtrl( "RESTORE", <handle> )
WinCtrl( "CLOSE", <handle> )
WinCtrl( "MENU", <handle> )
WinCtrl( "HELP", <handle> )
WinCtrl( "DEFAULT", <handle> )
WinCtrl( "NEXTWINDOW", <handle> )
WinCtrl( "PREVWINDOW", <handle> )
WinCtrl( "TASKLIST", <handle> )
WinCtrl( "SIZE", <handle>, <x>, <y> )
WinCtrl( "MOVE", <handle>, <x>, <y> )

WinCtrl( "SCREENSAVE", <handle> )
- executes the screen saver application

WinCtrl( "MONITORPOWER", <handle>, <mode> )
- Sets the state of the display. This command supports
devices that have power-saving features, such as a
battery-powered personal computer.
The <mode> parameter can have the following values:
1 - the display is going to low power
2 - the display is being shut off


Examples:

h = WinCtrl( "GET_FOREGROUND" )
WinCtrl( "SCREENSAVE", h )

h = WinCtrl( "GET_DESKTOP" )
WinCtrl( "MONITORPOWER", h, 1 )