Unit1.h內容
語法:
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
#define MYNOTIFYICONID WM_USER+10
#define MYWM_NOTIFYICON WM_USER+20
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TPopupMenu *PopupMenu1;
TMenuItem *N1;
TMenuItem *N2;
TMenuItem *N3;
TMenuItem *N4;
void __fastcall FormActivate(TObject *Sender);
void __fastcall N2Click(TObject *Sender);
void __fastcall N4Click(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall N1Click(TObject *Sender);
private: // User declarations
NOTIFYICONDATA Icon;
void TForm1::ShowIcon();
void TForm1::HideIcon();
public: // User declarations
__fastcall TForm1(TComponent* Owner);
void virtual _fastcall TRAYCALLBACK(TMessage& Message);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(MYWM_NOTIFYICON,TMessage,TRAYCALLBACK)
END_MESSAGE_MAP(TForm)
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
粗體部分需要自行KeyIn