开发者

Not receiving WM_QUERYENDSESSION when minimized to system tray

开发者 https://www.devze.com 2022-12-18 01:40 出处:网络
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

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

精彩评论

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

关注公众号