How to detect Print command has finished in TWebBrowser?
问题 procedure TForm1.Button1Click(Sender: TObject); var vaIn, vaOut: OleVariant; begin WebBrowser1.Navigate('http://www.google.com'); while WebBrowser1.ReadyState < READYSTATE_COMPLETE do Application.ProcessMessages; WebBrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, vaIn, vaOut); // HOWTO: WAIT until print <strike>job</strike> dialog is done or canceled // UPDATE (1): WebBrowser1.Enabled := False; WebBrowser1.OnCommandStateChange := WebBrowser1CommandStateChange; end; procedure TForm1