Help - delphi 6 help whats this

Top  Previous  Next

// Usar o help what's this

// desviar o Application.OnHelp para uma função de tratamento do Help, como mostra o exemplo abaixo:

type

  TForm1 = class(TForm)

  Edit1: TEdit;

  procedure FormCreate(Sender: TObject);

private

  function AppHelp(Command: Word; Data: Longint; var CallHelp: Boolean): Boolean;

end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

function TForm1.AppHelp(Command: Word; Data: Longint; var CallHelp: Boolean): Boolean;

begin

  WinHelp(Application.Handle, PChar(Application.HelpFile), Command, Data);

  CallHelp := False;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  Application.OnHelp := AppHelp;

end;

end.