码迷,mamicode.com
首页 > 移动开发 > 详细

Application HookMainWindow

时间:2014-09-01 12:20:53      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   io   ar   for   div   cti   

//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; }

 

Application HookMainWindow

标签:style   blog   color   os   io   ar   for   div   cti   

原文地址:http://www.cnblogs.com/cb168/p/3948870.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!