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

Function ui_window_hook_message

Pythonwin/win32win.cpp:1574–1595  ·  view source on GitHub ↗

@pymethod object|PyCWnd|HookMessage|Hook a message notification handler

Source from the content-addressed store, hash-verified

1572
1573// @pymethod object|PyCWnd|HookMessage|Hook a message notification handler
1574static PyObject *
1575ui_window_hook_message(PyObject *self, PyObject *args)
1576{
1577 // @comm The handler object passed will be called as the application receives messages with the specified ID.
1578 // Note that it is not possible for PythonWin to consume a message - it is always passed on to the default handler.
1579 // The handler will be called with 2 arguments<nl>
1580 // * The handler object (as per all hook functions).<nl>
1581 // * A tuple representing the message.<nl>
1582 // The message tuple is in the following format:
1583 // @tupleitem 0|int|hwnd|The hwnd of the window.
1584 // @tupleitem 1|int|message|The message.
1585 // @tupleitem 2|int|wParam|The wParam sent with the message.
1586 // @tupleitem 3|int|lParam|The lParam sent with the message.
1587 // @tupleitem 4|int|time|The time the message was posted.
1588 // @tupleitem 5|int, int|point|The point where the mouse was when the message was posted.
1589
1590 // @pyparm object|obHandler||The handler for the message notification. This must be a callable object.
1591 // @pyparm int|message||The ID of the message to be handled.
1592 // @rdesc The return value is the previous handler, or None.
1593 PyCWnd *s = (PyCWnd *)self;
1594 return add_hook_list(s, args,&s->pMessageHookList);
1595}
1596// @pymethod int|PyCWnd|IsChild|Determines if a given window is a child of this window.
1597PyObject *
1598ui_window_is_child(PyObject *self, PyObject *args)

Callers

nothing calls this directly

Calls 1

add_hook_listFunction · 0.85

Tested by

no test coverage detected