1,221
社区成员
发帖
与我相关
我的任务
分享
//.h
class TForm1 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
void __fastcall OnPOSCHANGING(TWMWindowPosChanged &Msg);
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_WINDOWPOSCHANGING,TWMWindowPosChanging,OnPOSCHANGING)
END_MESSAGE_MAP(TForm)
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//-
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int i ;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
i = 0 ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OnPOSCHANGING(TWMWindowPosChanging &Msg)
{
i++;
Caption = IntToStr(i);
}
void __fastcall TForm1::ApplicationEvents1Message(tagMSG &Msg,
bool &Handled)
{
if (Msg.message == WM_WINDOWPOSCHANGING)
{
// ...
}
}