52b Subj : TWMNCHitTest To : borland.public.cpp.borlandcpp From : "Richard Kavanagh" Date : Tue Jul 15 2003 11:20 am I needed to drag a Form with no title bar accross the screen. So I used the following Macro BEGIN_MESSAGE_MAP VCL_MESSAGE_HANDLER(WM_NCHITTEST, TWMNCHitTest, WMNCHitTest) END_MESSAGE_MAP(TForm) together with this private function void __fastcall TForm1::WMNCHitTest(TWMNCHitTest &Message) // needed to move the form as it has no titlebar { TForm::Dispatch(&Message); if (Message.Result == HTCLIENT) Message.Result = HTCAPTION; } // ------------------------------------------------- An annoying compiler warning to do with switch statements not expanding inline occurred. So I translated the Macro to protected: virtual inline void __fastcall Dispatch(void* message); and void __fastcall TForm1::Dispatch(void* message) { if(static_cast(message)->Msg == WM_NCHITTEST) WMNCHitTest( *static_cast(message) ); else TForm::Dispatch(message); } // ------------------------------------------------- and everything worked fine. However I can find no documentation to describe the object type TWMNCHitTest. I hate using things I do not understand. Is there anybody who can enlighten me. Richard K . 0