(Form1);String Str;
Str = \"Lines \";
Str += \"----------------- \";
Str += IntToStr(++ num);
eventForm-> Log-> Lines-> Add(Str);
}
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::StartClick(TObject *Sender)
{
int TimeInterval = 1;
TimeID = timeSetEvent(TimeInterval,TimeAccuracy,&TimeCallProc,1,TIME_PERIODIC);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::StopClick(TObject *Sender)
{
timeKillEvent(TimeID);
}
//---------------------------------------------------------------------------
.h
//$$---- Form HDR ----
//---------------------------------------------------------------------------
#ifndef u_TimeEventH
#define u_TimeEventH
//---------------------------------------------------------------------------
#include #include #include #include //---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Start;
TButton *Stop;
TMemo *Log;
void __fastcall StartClick(TObject *Sender);
void __fastcall StopClick(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif