How to use the Win95 Help (What's this?) button (Views: 102)
How to use the Win95 Help (What's this?) button
The help button is supposed to be used only with dialogs, Borderstyle := bsDialog. This is a Microsoft thingy, for a main window you are supposed to provide either a menu item or a speedbutton that does a SendMessage(windowhandle, WM_SYSCOMMAND, SC_CONTEXTHELP, 0) to get the window into the context help mode.
The help button is only available if biMinimize and biMaximize is not set. Furthermore, sometimes you have to override the CreateParams method and set the style accordingly.
TfrmMain = class(TForm)
procedure CreateParams(var Params: TCreateParams); override;
procedure TfrmMain.CreateParams(var Params: TCreateParams);
Params.Style := Params.Style or DS_CONTEXTHELP;
Params.ExStyle := Params.ExStyle or WS_EX_CONTEXTHELP;
<< Back to main page