10-18-2007, 06:57 AM
This function clicks the html element without the mouse. It works like Htm.Click, but does not wait while the web page is processing the click. Useful, for example, when the web page displays a dialog or message box. With Htm.Click, the macro would wait until the user closes it. With this function, the macro does not wait, and itself can populate/close the dialog box.
Member function Htm.ClickAsync. Create it using menu File -> New -> New Member Function.
Also create this function. Create it using menu File -> New -> New Function.
Function __htm_clickasync
Member function Htm.ClickAsync. Create it using menu File -> New -> New Member Function.
;Clicks the element without waiting.
;Note: The autodelay (spe) of the caller is applied.
;EXAMPLE
;;clicks a link that displays a message box "VBScript", and closes the message box
;int w1=win("Internet Explorer" "IEFrame")
;act w1
;Htm el=htm("A" "msgbox" "" w1 0 0 0x21)
;el.ClickAsync
;int w2=wait(10 WV "VBScript")
;clo w2
if(!el) end ES_INIT
if(CoMarshalInterThreadInterfaceInStream(uuidof(MSHTML.IHTMLElement) el +&_i)) end ES_FAILED
__Handle ev=CreateEvent(0 0 0 0)
mac "__htm_clickasync" "" _i ev
wait 30 H ev; err end _error
wait -2
Also create this function. Create it using menu File -> New -> New Function.
Function __htm_clickasync