HH_GET_WIN_TYPE
Returns a pointer to a THHWinType record associated with the window.
Argument | Description |
---|---|
hwndCaller | Ignored |
pszFile | HTML Help URL: Compiled help (.chm) file > Window |
uCommand | HH_GET_WIN_TYPE |
dwData | Pointer to a PHHWinType record |
Return value:
If the command succeeds the return value is a handle to the helpwindow. On failure
the command returns -1 if the window does not exist or 0 if the window does exist but has
not been created yet.
Description:
The HH_GET_WIN_TYPE command returns a pointer to a THHWinType record which contains
information about the specified window. The window for which you request information must
exist in the specified compiled help (.chm) file and the window must have been previously
created. Note that the record returned to the application is still owned by HTML Help and
you should not attempt to modify it. Instead copy it and modify this copy. Also be warned
that the dwData parameter must be a pointer-to-a-pointer to a THHWinType record. Thus you
have to pass in DWORD(@WinType) where WinType is declared as PHHWinType.
Example:
var
Wnd: HWND;
WinType: PHHWinType;
begin
Wnd := HtmlHelp(0, PChar('JediHtmlHelp.chm>Main'), HH_GET_WIN_TYPE, DWORD(@WinType));
// At this point if Wnd = 0 the window hasn't been
created yet, create it by displaying
// a topic and then try again
if Wnd = 0 then
begin
HtmlHelp(0, PChar('JediHtmlHelp.chm>Main'), HH_HELP_CONTEXT, 1000);
Wnd := HtmlHelp(0, PChar('JediHtmlHelp.chm>Main'), HH_GET_WIN_TYPE, DWORD(@WinType));
end;
// if Wnd > 0 we have a valid WinType
record, show the HH URL for the TOC
if Wnd > 0 then
ShowMessage('TOC: ' + WinType^.pszToc);
end;
See also:
HH_SET_WIN_TYPE