[wxPython-users] Re: IEHtmlWindow GetScrollPos
Robin Dunn
robin at alldunn.com
Mon Nov 12 14:52:16 PST 2007
David Montgomery wrote:
> Robin Dunn:
>> The scrollbars in the IEHtmlWindow don't belong to wxWidgets so it has
>> no access to them.
>
> Ken Seehart:
>> Is there any workaround for this?
>
> Robin Dunn:
>> Not that I know of, but perhaps you can get a low enough level of access
>> using the win32com and win32api modules. Or perhaps ctypes. In other
>> words if you can find the window handle of the IE window, or even the
>> handles of the scrollbars, then you can call the raw win32 API functions
>> using those handles and get what you need.
>
> Robin, thanks for this suggestion. Indeed, if you send the
> appropriate win32 messages to the "Internet Explorer_Server"
> window, you can scroll it. I have a demonstration
> implementation using win32gui sending (WM_VSCROLL, SB_BOTTOM).
Good news!
>
> If I manually push a button that sends this, everything is fine.
>
> But if I send it automatically after the window is updated
> using LoadString, it doesn't work. It appears that the
> window is doing some updating of its own after I send my
> message, and this updating overrides or prevents the scrolling.
>
> Waiting for the DocumentComplete event is definitely insufficient.
> Posting an event back to myself from the DocumentComplete handler
> still gets the undesired behavior.
>
> What is working is to do a CallLater to do the scroll, with
> a 1/10th second delay after DocumentComplete fires.
>
> But this seems quite bogus. It seems there should be some
> event that I can wait for, such that when it occurs, the
> IEHtmlWindow is *really* complete with its processing, and
> now sending the win32 scrolling message will work, just like
> it would if I waited 1/2 a second.
>
> Any suggestions on what event this would be for an IEHtmlWindow
> updated via LoadString?
No idea, sorry. Based on your experiences with this you now officially
know more about it than I do. ;-)
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list