//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TAppOnHelp.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: TApplicationOnHelp
// Event: Forms.TApplication.OnHelp
// Property: Forms.TApplication.HelpFile

// Warning: No online help for this app, so just put up a dialog box
// to show what HLP file it's using.

// BeginCode
/*
The following code changes the Help file depending on the
active form, before the help viewer is called. AppHelp is
assigned to the OnHelp event handler of Application in the
OnCreate event of Form1.
*/
bool __fastcall TForm1::AppHelp(Word Command, int Data, bool &CallHelp)
{
  Application->HelpFile = Screen->ActiveForm->Name + ".hlp";
  CallHelp = true;
  return true;
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  Application->OnHelp = AppHelp;
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  const DATANOTFOUND = 714;
  Application->HelpContext(DATANOTFOUND);
}
// EndCode
// EndExample: TApplicationOnHelp
//---------------------------------------------------------------------------
