How to receive events (eg. user mouse clicks) from IE

Roger Upole rupole at hotmail.com
Sat May 21 11:45:37 EDT 2005


There does appear to be some sort of conflict between the two event
hooks.  I wasn't seeing it before since IE was getting google from my
browser cache and it was coming up almost instantaneously.  As soon
as I switched the URL to a page that loads slowly, I got the same
result.

   Adding win32gui.PumpWaitingMessages() to the wait loop
seems to allow both event hooks to run without blocking each other.

     Roger


<cal_2pac at yahoo.com> wrote:
> Thanks for the response again. The solution is pretty close but not yet
> complete
> This is what I observed.
> a) I tried to use the delay mechanism as suggested below
> ie.
> ie.Navigate('www.google.com')
> while ie.ReadyState !- 4
>       time.sleep(0.5)
>
> d=win32com.client.DispatchWithEvents(ie.Document, Doc_Events)
>
> IE *fails* to load the webpage
>
> b) Then I changed the delay to a specified time interval eg
> ie.Navigate('www.google.com')
> time.sleep(60) #wait for a minute
> d=win32com.client.DispatchWithEvents(ie.Document, Doc_Events)
>
> IE loads the web page *after* 60 seconds
>
> c) Then I used raw_input() eg
> ie.Navigate('www.google.com')
> raw_input()
> d=win32com.client.DispatchWithEvents(ie.Document, Doc_Events)
> IE now loads the webpage and prompts the user. If I click on the web
> page *before* clicking ok on the raw_input prompt - then it correctly
> invokes the Doc_Events method Ononactivate method.
>
>>From these observations, it seems that there is some kind of a race
> condition / timing issue happening. Can you please comment (or maybe
> point me to other sources of info that I can investigate).
> I am running Python 2.3 on Windows 2k machine.
>



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



More information about the Python-list mailing list