winapi: mouseclick

KNS netquest at sympatico.ca
Tue Jan 27 17:52:50 CET 2004


Thank you for the response.  I am actually using win32all to launch an 
application and am waiting for user actions or changes in state.  Once 
the application is launched (e.g., IE) the program just records changes 
in URLs.  Now I would like the various states (e.g., time, mouse 
position) saved whenever the mouse is clicked on the application (or
even the desktop).  So, can I just use an 'if' (within a while-loop) to 
test whether WM_LBUTTONDOWN == 0 and if so what is the appropriate 
syntax with win32all?

Thanks.


Tim Golden wrote:
>>-----Original Message-----
>>From: KNS [mailto:netquest at sympatico.ca]
>>Sent: 27 January 2004 08:19
>>To: python-list at python.org
>>Subject: Re: winapi: mouseclick
>>
>>
>>
>>Just to add some clarification, this is in fact a Python question.
>>I'm just working within the Windows environment.  And, now that
>>I'm here, I'm certain this is child's play for many of you, so
>>a bit of help would be most welcomed.
>>
>>Thanks.
>>
>>KNS wrote:
>>
>>>Hello,
>>>
>>>Can someone please suggest how to test for a mouse click using
>>>the WinAPI?  I have dispatched a windows application and would
>>>like to detect any mouseclicks (and keyboard entry for that 
>>
>>matter)...
>>
>>>Thanks.
>>>
>>
> 
> <sigh>
> Your question is not the most precise one I've ever seen. If
> you have written a Windows app then you presumably understand
> how the Windows messaging setup works. In which case, what
> you need to do is to handle WM_LBUTTONDOWN and related messages. 
> 
> If you're not sure which messages to go for, look at this:
> 
> http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/use
> rinput.asp
> 
> which gives an overview.
> 
> There's an example of doing this kind of thing in Python
> using the ctypes modules:
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/208699
> 
> You can also do it with the win32all extensions from Mark
> Hammonds pages:
> 
> http://starship.python.net/crew/mhammond/win32/Downloads.html
> 
> If this isn't really what you were asking, could you post a
> segment of code showing what you're about and where you're
> stuck?
> 
> TJG
> 
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
> 




More information about the Python-list mailing list