[python-win32] HookMessage failure?

Marcus Goldfish magoldfish at gmail.com
Sun Apr 10 07:12:43 CEST 2005

On Apr 7, 2005 12:47 AM, Daniel F <nanotube at gmail.com> wrote:
> Hey Mark,
> the correct mesage to hook is "win32con.WM_LBUTTONDOWN"
> try it with this one, and see if that works.
> -d
> On 7 Apr 2005 02:15:41 -0000, b6y9eq902 at sneakemail.com
> <b6y9eq902 at sneakemail.com> wrote:
> > Hey,
> >
> > I'm currently trying to detect all clicks to a particular windows

Did you get this to work?  I tried the following snippet to no avail. 
Anyone have suggestions?

import winGuiAuto
import win32ui, win32con

def handler(*args):
   print "handler called"

hwnd = winGuiAuto.findTopWindow("calculator")
pwin = win32ui.CreateWindowFromHandle(hwnd)
pwin.HookMessage(handler, win32con.WM_LBUTTONDOWN)

More information about the Python-win32 mailing list