Help-processing is done in two stages. The first stage is the creation of the WM_HELP message. This is done:
The second stage of processing of help is the processing of the WM_HELP message.
The frame window procedure sees the WM_HELP message because the frame is usually the active window. It processes the WM_HELP message as follows:
usMode = HLPM_WINDOW idTopic = frame-window
id
idSubTopic = focus-window id.
usMode = HLPM_WINDOW
idTopic = focus-window parent id
idSubTopic = focus-window id.
The message box window procedure sees the WM_HELP message, because it subclasses the frame window. It processes the WM_HELP message by calling the help hook, specifying:
usMode = HLPM_MESSAGE idTopic = message
id
idSubTopic = control id.
The menu window procedure sees the WM_HELP message because it runs a modal loop. It processes the WM_HELP message by calling the help hook, specifying:
usMode = HLPM_MENU idTopic = menu id of
pulldown
idSubTopic = menu id of item.
The WinDefWindowProc function sees the WM_HELP message for a FID_CLIENT window if the client does not handle it itself. It calls the help hook, specifying:
usMode = HLPM_WINDOW idTopic = active-window
id
idSubTopic = focus-window id.
An application sees the WM_HELP message in its dialog procedure. The application can ignore the WM_HELP message, in which case the frame-window procedure action occurs (as described above) or it can simulate a call to the help hook itself, using:
usMode = HLPM_APPLICATION idTopic = any
value
idSubTopic = any value.
The input focus is never given to any of the standard frame controls, so help for these cannot be obtained.