Sends a message to a Dummy control.
GUICtrlSendToDummy ( controlID [, state] )
Parameters
| controlID | The control identifier (controlID) as returned by GUICtrlCreateDummy |
| state | [optional] value that can be retrieved later on by GUICtrlRead |
Return Value
| Success: | Returns 1. |
| Failure: | Returns 0. |
Remarks
When this function is called a notification that can be handled through the message loop or with a OnEvent function is generated (as if the control had been "clicked" on).
Related
GUICtrlCreateDummy, GUICtrlSetOnEvent, GUICtrlRead
Example
#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Global $user
Example()
Func Example()
Local $iOldOpt, $button
$iOldOpt = Opt("GUIOnEventMode", 1)
GUICreate("GUISendToDummy", 220, 200, 100, 200)
GUISetBkColor(0x00E0FFFF) ; will change background color
GUICtrlSetOnEvent($GUI_EVENT_CLOSE, "OnClick") ; to handle click on button
$user = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "Onexit") ; to handle click on button
$button = GUICtrlCreateButton("event", 75, 170, 70, 20)
GUICtrlSetOnEvent(-1, "OnClick") ; to handle click on button
GUISetState()
While 1
Sleep(100)
WEnd
Opt("GUIOnEventMode", $iOldOpt)
EndFunc ;==>Example
Func OnClick()
GUICtrlSendToDummy($user) ; fired dummy control
EndFunc ;==>OnClick
Func OnExit()
; special action before exiting
Exit
EndFunc ;==>OnExit