The message control hook allows the application to determine the flow of messages to be intercepted. The following code shows the syntax for a message control hook function:
BOOL EXPENTRY MsgControlHook(HAB hab, LONG/SHORT idContext, HWND hwnd, PSZ pszClassname, ULONG/USHORT usMsgclass, LONG/SHORT idControl, PBOOL fSuccess);
If the hook is unable to alter the message control state, then the hook must establish the relevant error information.
The hab parameter is the anchor block handle.
The idContext parameter is the origin of the call to the hook and has one of the following values:
MCHK_CLASSMSGINTEREST
The hwnd parameter is the window handle.
The pszClassName parameter is the window class name.
The usMsgClass parameter is the message class.
The idControl parameter is the control setting.
The fSuccess parameter is the success indicator and is either TRUE (success) or FALSE (error).
This function returns either TRUE or FALSE. If it returns TRUE, the next hook in the chain is not called. If it returns FALSE, the next hook in the chain is called.