Search code examples
windowsdelphiwinapidelphi-2010

How do I put a form in to help mode?


I am trying to put form into "help mode" in Delphi 2010.

I have a button which the user clicks, and I want the cursor to change to the help cursor, then when a user clicks onto a control, the help for the control is displayed

Is there a window message that I can send?


Solution

  • Send a WM_SYSCOMMAND message to the form passing SC_CONTEXTHELP as lParam.

    Changes the cursor to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message.

    Write something like this in your button OnClick event handler:

    procedure TMyForm.Button1Click(Sender: TObject);
    begin
      SendMessage(Handle, WM_SYSCOMMAND, SC_CONTEXTHELP, 0);
    end;