ssCore.Win.sendMessage

Send an action message to a target window identified by a window handle (hwnd) or group of windows identified by a partial caption.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

hwnd - [Optional] - Handle of the target window where the message should be sent. If the hwnd is 0 or missing and another window target is not specified, the message will be sent to the application window.

target - [Optional] - The target window (or windows) where the message should be sent. The target string is compared against the caption of all top level windows and the action message is sent to any window caption that matches the target string. A caption matches the target if the target string appears in any part of the window caption.

message - The name of an action message to be sent to a window. Valid values include: Kill, Topmost, NoTopmost, BringToFront, SendToBack, Minimize, Maximize, and Restore.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Win.sendMessage( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Win.sendMessage( paramsObject );


Notes:

None.


Examples:

The following example kills all running instances of Internet Explorer.

ssCore.Win.sendMessage({target:"Internet Explorer", message:"Kill"});