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,
) ? Handled = false : Handled = true;
break;
}
return Handled;
}
上一篇:中国写生簿行业市场供需与战略研究报告


下一篇:excel 怎么添加超链接