[python-win32] win32com IE OnBeforeNavigate2: How to Cancel?

Robert kxroberto at googlemail.com
Thu Feb 25 21:02:16 CET 2010


oh, found I have to return a 7-tuple with Cancel as last one


    return  None, None, None, None, None, None, args.Cancel



Robert wrote:
>
>
> class MyWebBrowser(activex.Control, WebBrowserModule.WebBrowser):
> def OnBeforeNavigate2(self, pDisp, URL, Flags, TargetFrameName,
> PostData, Headers, Cancel):
> ...
>
>
> Cancel is a simple Python bool. Unlike in MFC
> CHtmlView::OnBeforeNavigate2 I cannot send a value back by ref this way.
> How to cancel the navigation?
>
> Robert
>
>
>
>
>
>
>
> ---------
> This member function is called by the framework to cause an event to
> fire before a navigation occurs in the web browser.
>
> virtual void OnBeforeNavigate2(
> LPCTSTR lpszURL,
> DWORD nFlags,
> LPCTSTR lpszTargetFrameName,
> CByteArray& baPostedData,
> LPCTSTR lpszHeaders,
> BOOL* pbCancel
> );




More information about the python-win32 mailing list