The send message hook enables an application to monitor messages that the system does not post to a queue. The system calls a send message hook function while processing WinSendMsg, before delivering the message to the recipient window. By installing an input-hook function and a send message hook function, an application can monitor all window messages effectively. The following code shows the syntax for a send message hook function:
VOID EXPENTRY SendMsgHook(HAB hab, PSMHSTRUCT psmh, BOOL fInterTask);
The psmh parameter is a pointer to an SMHSTRUCT data structure that contains information about the message.
The fInterTask parameter is TRUE if the message is sent between two threads, or FALSE if the message is sent within a thread.
A send message hook function does not return a value, and the next function in the chain is always called. The function can modify values in the SMHSTRUCT data structure before returning.