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: