cPostButton

Clicks a button, emulating a user. This uses an undocumented method, different from cClickButton, that seems to work when cClickButton causes the script to hang. 

Syntax:

cPostButton( hwnd )

Parameters:

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

Returns:

(i) always 1.

 

This function is designed to click a push button. As opposed to cClickButton, this method may be tried when the cClickButton appears to cause the script to hang. If your script seems to hang after a cClickButton call, try the cPostButton function instead.

 

Example:

AddExtender("wwctl44i.dll",0,"wwctl64i.dll")
; This WinXP example launches Notepad, selects the File|Open menu
; fills in the filename editbox with *.* then clicks on the Open button.
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 = cPostButton(openbutton)
Message('Open file mask changed to *.*','and Open button clicked.')
Exit

See Also:

 

cClickButton , cCheckBox, cRadioButton