cClickButton

Clicks a button, emulating a user.

Syntax:

cClickButton( hwnd )

Parameters:

(i) hwnd PushButton handle from a cWndBy... function.

Returns:

(0) always 0.

 

This function is designed to click a push button. However it can also be used to click most types of controls that can accept a button click. This function uses the recommended procedures to push the button. However in some cases the script will appear to hang. If your script seems to hang after a cClickButton call, try the cPostButton function instead.

 

Example:
; This example launches Notepad, selects the File|Open menu
; fills in the filename editbox with *.* then clicks on the Open button.
AddExtender("wwctl44i.dll",0,"wwctl64i.dll")
Run("notepad.exe","") SendMenusTo("~Notepad","FileOpen") WinWaitExist('Open',5) window1=DllHwnd('Open') window2=cWndbyclass(window1,`ComboBoxEx32`) window3=cWndbyclass(window2,`ComboBox`) ControlHandle=cWndbyclass(window3,`Edit`) mask=cSetEditText(ControlHandle, '*.*') openbutton=cWndbyname(window1,`Open`) ret = cClickButton(openbutton) Message('Open file mask changed to *.*','and Open button clicked.') Exit
See Also:

cPostButton, cCheckBox, cRadioButton