HH_SET_WIN_TYPE

Creates or modifies a window definition

Argument Description
hwndCaller Ignored
pszFile HTML Help URL: Compiled help (.chm) file or nil for a global window
uCommand HH_SET_WIN_TYPE
dwData Pointer to a THHWinType record

Return value:
On success the result is either the handle to the window that was modified. On failure the result is 0.

Description:
The HH_SET_WIN_TYPE command creates a new windows definition or modifies an existing one. You can use this command to create window types on the fly or to modify a window type defined in the compiled help (.chm) file to suit your needs. Note that when you modify an existing window type that some changes will not be effective until the window is closed and reopened. Also some properties cannot be changed at all.

You can create a global window type which can be used from all applications by specifying nil for the pszFile parameter when creating the window definition. Alternatively you can prefix the window definition name with the string "$global_".

Example:
This example shows the simplest usage of the HH_SET_WIN_TYPE command. It creates a new window definition names MyWindowType which consists only of the content pane and then attempts to show a topic in this newly defined window type.

procedure TForm1.Button1Click(Sender: TObject);
var
  Wnd: HWND;
  WinType: THHWinType;
begin
  FillChar(WinType, SizeOf(WinType), 0);
  WinType.cbStruct := SizeOf(WinType);
  WinType.fUniCodeStrings := False;
  WinType.pszType := PChar('MyWindowType');
  WinType.fsValidMembers := HHWIN_PARAM_PROPERTIES or HHWIN_PARAM_SHOWSTATE;
  WinType.fsWinProperties := 0;
  WinType.pszCaption := PChar('Runtime Window!');
  WinType.dwStyles := 0;
  WinType.dwExStyles := 0;
  WinType.rcWindowPos := Rect(0, 0, 0, 0);
  WinType.nShowState := SW_SHOW;
  WinType.paInfoTypes := nil;
  Wnd := HtmlHelp(0, PChar('JediHtmlHelp.chm'), HH_SET_WIN_TYPE, DWORD(@WinType));
  HtmlHelp(0, PChar('JediHtmlHelp.chm>MyWindowType'), HH_HELP_CONTEXT, 1000);
end;

See also:
HH_GET_WIN_TYPE