I've tried a WindowEvent() after the ExecWB call at the bottom but haven't had any luck getting any kind of sensible order out of it. Can anyone think of any reason that might be happening?
Code: Select all
Procedure print_webgadget(webgadget.l,type.l)
WebObject.IWebBrowser2 = GetWindowLong_(GadgetID(webgadget), #GWL_USERDATA)
Repeat
WebObject\get_Busy(@IsBusy.l)
Delay(1)
While WindowEvent(): Wend
Until IsBusy = 0
; Type is the operation to perform.
Select type
Case 0
WebObject\ExecWB(#OLECMDID_PRINT, #OLECMDEXECOPT_PROMPTUSER, 0, 0)
Case 1
WebObject\ExecWB(#OLECMDID_PRINT, #OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)
Case 2
WebObject\ExecWB(#OLECMDID_PRINTPREVIEW, #OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)
EndSelect
EndProcedure
