MCPcopy Create free account
hub / github.com/mhammond/pywin32 / Python_check_message

Function Python_check_message

Pythonwin/win32win.cpp:70–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70BOOL Python_check_message(const MSG *msg) // TRUE if fully processed.
71{
72 BOOL ret;
73 ui_assoc_object *pObj = NULL;
74 PyObject *method;
75 CWnd *pWnd = bInFatalShutdown ? NULL : CWnd::FromHandlePermanent(msg->hwnd);
76 // is_uiobjects calls python methods, must already hold lock
77 CEnterLeavePython _celp;
78 if (pWnd &&
79 (pObj=ui_assoc_object::GetAssocObject(pWnd)) &&
80 pObj->is_uiobject( &PyCWnd::type ) &&
81 ((PyCWnd *)pObj)->pMessageHookList &&
82 ((PyCWnd *)pObj)->pMessageHookList->Lookup(msg->message,(void *&)method)) {
83
84#ifdef TRACE_CALLBACKS
85 TRACE("Message callback: message %04X, object %s (hwnd %p) (%p)\n",msg->message, (const char *)GetReprText(pObj), pWnd, pWnd->GetSafeHwnd());
86#endif
87 // Our Python convention is TRUE means "pass it on"
88 // CEnterLeavePython _celp;
89 ret = Python_callback(method, msg)==0;
90 } else
91 ret = FALSE; // dont want it.
92 Py_XDECREF(pObj);
93 return ret;
94}
95
96BOOL Python_check_key_message(const MSG *msg)
97{

Callers 2

CallWndProcFunction · 0.85

Calls 5

GetAssocObjectFunction · 0.85
GetReprTextFunction · 0.85
Python_callbackFunction · 0.85
is_uiobjectMethod · 0.80
GetSafeHwndMethod · 0.80

Tested by

no test coverage detected