Hi!
I'm trying to set a message hook with python to catch WM_DROPFILES.
The guiframework is Tkinter.
Here a code snippet:
hwnd = eval(self.wm_fr ame())
win32gui.DragAc ceptFiles(hwnd, 1)
wnd = win32ui.CreateW indowFromHandle (hwnd)
wnd.HookMessage (self.test,w32c on.WM_DROPFILES )
win32gui.DragAc ceptFiles(hwnd, 1)
wnd = win32ui.CreateW indowFromHandle (hwnd)
wnd.HookMessage (self.test,w32c on.WM_DROPFILES )
def test(self):
print "blala"
print "blala"
the gui there is this drag-and-drop icon. But the problem is, that the
callback-function (test) is never executed.
I also try different messages like Mousemove or Buttondown. So i think
there is a problem with the HookMessage function.
I read that you must compile Python with PYWIN_WITH_WIND OWPROC option
enabled. Is this the problem?
Can someone give me a short working code to hook a message so i can try
it on my workstation?
Thx in advance!
Comment