Application HookMainWindow

//H  File
bool
__fastcall AppHookFunc(TMessage &Message);
//cpp file
void __fastcall TForm2::FormCreate(TObject *Sender) { Application->HookMainWindow(this->AppHookFunc); } // --------------------------------------------------------------------------- void __fastcall TForm2::FormClose(TObject *Sender, TCloseAction &Action) { Application->UnhookMainWindow(this->AppHookFunc); } bool __fastcall TForm2::AppHookFunc(TMessage &Message) { bool Handled; switch (Message.Msg) { case WM_CLOSE: mrYes == MessageDlg("Really Close??", mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) ? Handled = false : Handled = true; break; } return Handled; }

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。