Esempio n. 1
0
 def _wndproc(self, hwnd, msg, wparam, lparam):
     event_name = WNDPROC_EVENT_NAMES.get(msg, msg)
     callback = self._message_map.get(msg)
     v = CallWindowProc(self._oldwndproc, hwnd, msg, wparam, lparam)
     vlog("_wndproc%s event name=%s, callback=%s", (hwnd, msg, wparam, lparam), event_name, callback)
     if callback:
         #run our callback
         callback(hwnd, msg, wparam, lparam)
     vlog("_wndproc%s return value=%s", (hwnd, msg, wparam, lparam), v)
     return v
Esempio n. 2
0
 def _wndproc(self, hwnd, msg, wparam, lparam):
     event_name = WNDPROC_EVENT_NAMES.get(msg, msg)
     callback = self._message_map.get(msg)
     vlog("_wndproc%s event name=%s, callback=%s", (hwnd, msg, wparam, lparam), event_name, callback)
     v = None
     if callback:
         #run our callback
         try:
             v = callback(hwnd, msg, wparam, lparam)
             vlog("%s%s=%s", callback, (hwnd, msg, wparam, lparam), v)
         except Exception as e:
             log.error("Error: callback %s failed:", callback)
             log.error(" %s", e)
     #if our callback doesn't define the return value, use the default handler:
     if v is None:
         v = CallWindowProc(self._oldwndproc, hwnd, msg, wparam, lparam)
         vlog("_wndproc%s return value=%s", (hwnd, msg, wparam, lparam), v)
     return v