object = HookMessage(obHandler, message )

Hook a message notification handler


obHandler : object

The handler for the message notification. This must be a callable object.

message : int

The ID of the message to be handled.


The handler object passed will be called as the application receives messages with the specified ID. Note that it is not possible for PythonWin to consume a message - it is always passed on to the default handler. The handler will be called with 2 arguments
The handler object (as per all hook functions).
A tuple representing the message.
The message tuple is in the following format:


[0] int : hwnd

The hwnd of the window.

[1] int : message

The message.

[2] int : wParam

The wParam sent with the message.

[3] int : lParam

The lParam sent with the message.

[4] int : time

The time the message was posted.

[5] int, int : point

The point where the mouse was when the message was posted.

Return Value

The return value is the previous handler, or None.