1 2 //-----------------------------UNIT1.H------------------------------------- 3 4 #ifndef Unit1H 5 #define Unit1H 6 //--------------------------------------------------------------------------- 7 #include <Classes.hpp> 8 #include <Controls.hpp> 9 #include <StdCtrls.hpp> 10 #include <Forms.hpp> 11 //--------------------------------------------------------------------------- 12 class TForm1 : public TForm 13 { 14 __published: // IDE-managed Components 15 private: // User declarations 16 void __fastcall WMWindowPosChanging(TMessage &Message); 17 18 public: // User declarations 19 __fastcall TForm1(TComponent* Owner); 20 BEGIN_MESSAGE_MAP 21 VCL_MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, TMessage,WMWindowPosChanging) 22 END_MESSAGE_MAP(TForm) 23 24 }; 25 //--------------------------------------------------------------------------- 26 extern PACKAGE TForm1 *Form1; 27 //--------------------------------------------------------------------------- 28 #endif 29 30 31 //-----------------------------UNIT1.CPP---------------------------------- 32 #include <vcl.h> 33 #pragma hdrstop 34 35 #include "Unit1.h" 36 //--------------------------------------------------------------------------- 37 #pragma package(smart_init) 38 #pragma resource "*.dfm" 39 TForm1 *Form1; 40 //--------------------------------------------------------------------------- 41 __fastcall TForm1::TForm1(TComponent* Owner) 42 : TForm(Owner) 43 { 44 } 45 //--------------------------------------------------------------------------- 46 47 void __fastcall TForm1::WMWindowPosChanging(TMessage &Message) 48 { 49 WINDOWPOS *wp = (WINDOWPOS*)Message.LParam; 50 wp->flags |= SWP_NOMOVE; 51 Message.Result = 0; 52 } 53 54