|
App1에서 다음 명령을 수행해서 windows 종료 msg를 발생시키구요
::ExitWindowsEx(EWX_POWEROFF,0);
app2에서 message map 을 만들어서요.
class TForm1 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
void __fastcall WinCloseCommand(TMessage& Msg);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_QUERYENDSESSION, TMessage, WinCloseCommand)
END_MESSAGE_MAP(TForm)
};
문제는 다음과 같이 함수를 작성하면 msg box만 보여주고 종료과정이 더이상 진행되지 않는다는점이며
두번째 라인의 주석처리를 제거하면 다운됩니다. ( 재귀호출이 되는것 같습니다.) 어떻게 원하는 명령을 수행한 후에도 windows를 종료시킬수 있을까요?
void __fastcall TForm1::WinCloseCommand(TMessage& Msg)
{
ShowMessage("종료합니다. ");
//::ExitWindowsEx(EWX_POWEROFF,0);
}
|