Windows Help requires an application to explicitly cancel Help so that Windows Help can free any resources it used to keep track of the application and its Help files. The application can do this at any time.
An application cancels Windows Help by calling the WinHelp function and specifying the HELP_QUIT value, as shown in the following example:
case WM_DESTROY:
WinHelp (hwnd, "myhelp.hlp", HELP_QUIT, NULL);
If the application has made any calls to the WinHelp function, it must cancel Help before it closes its main window (for example, in response to the WM_DESTROY message in the main window procedure). If the application has opened more than one Help file, it must call WinHelp to cancel Help for each file. Windows Help remains running until all applications or dynamic-link libraries that have called WinHelp function have canceled Help.
We strongly recommend that an application use the HELP_QUIT parameter in its exit routine even if it has not actually sent any other WinHelp calls.