开发者

Not receiving WM_QUERYENDSESSION when minimized to system tray

I'm trying to catch WM_QUERYENDSESSION to save some data in the app, but it seems that I'm not receiving this message on User logoff/system restart when the app is minimized to the system tray. How can I catch it?

Thanks.

Relevant code (nothing magic in there,开发者_StackOverflow hopefully :)):

ON_WM_QUERYENDSESSION()

BOOL CMainFrame::OnQueryEndSession()
{
    AfxMessageBox(L"Are we hitting this?");

 return FALSE;
}

For the tray icon I'm using a third-party lib (CodeJock), which I probably can't post here, but generally, it creates a hidden window to process messages, but the main window is simply ShowWindow(SW_HIDE) when needed. Maybe I need to intercept that message in that hidden window and pass it up, I'll need to try that.


This is basically eaten by a third-party class that I'll need to fix up.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜