Window.PostMessage
Description
- Sends a WinAPI PostMessage() call to each window matching the specified caption list.
Syntax
- Window.PostMessage(msg, wp, lp, han)
Parameters
- msg
- (mixed) the message to be posted
-
Possible Values
- wm_command
-
- wm_app
-
- wm_user
-
- wm_user+n
- where n is a number
- wp
- (integer) specifies additional message-specific information
- lp
- (integer) specifies additional message-specific information
- han
- (mixed) handle or class of the window(s) to act on
Return Value
- (boolean)
- 1
- Function succeeded.
- 0
- function failed
Examples
- Window.PostMessage_("wm_command", 1193, 0, "c=i_view32")
- Toggles the menubar in IrfanView.
- Window.PostMessage(0x112, 0xF170, 2, 0xFFFF)
- Turns off the screen.
- Use -1 as the 3rd parameter to turn the screen on, or 1 to make it dimmed.
Notes
- The WinAPI PostMessage() function posts a message in the message queue associated with the thread that created the target window, then returns immediately, without waiting for the message to be processed.
- Precede parameter integer values with "0x" to indicate a hexadecimal number, for example:
- Note that Window.PostMessage() is generally safer to use than Window.SendMessage(), unless a return is needed from the message handler.
See Also