HH_CLOSE_ALL

Closes all HTML Help windows.

Argument Description
hwndCaller Must be 0.
pszFile Must be nil
uCommand HH_CLOSE_ALL
dwData 0

Return value:
Always 0. HH_GET_LAST_ERROR returns no usefull information.

Description:
The HH_CLOSE_ALL command closes all HTML Help Windows that we're created directly or indirectly by the calling application. It does not close windows opened from other applications. You should always close your application by using this command or you risk access violations when you application terminates.

Example:

HtmlHelp(0, nil, HH_CLOSE_ALL, 0);

Notes:
If you have previously saved the handle returned from HtmlHelp when you opened the help window then instead of using the HH_CLOSE_ALL command you can also use the following code snippet which has the same effect but is a little faster:

if IsWindow(WndHandle) then SendMessage(WndHandle, WM_CLOSE, 0, 0);

If HTMLHELP_DYNAMIC_LINK is defined, the interface unit automatically calls HH_CLOSE_ALL in the modules finalization section.