Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
650 views
in Technique[技术] by (71.8m points)

session - What's the proper response to WM_ENDSESSION with ENDSESSION_CLOSEAPP and wParam == FALSE?

According to the WM_ENDESSION docs, when lParam is ENDSESSION_CLOSEAPP and wParam is FALSE, "the application should not shut down".

  • So, should I just ignore that and use the default response?
  • What is it's purpose?

(I'm listening to Windows events/messages in Qt (C++) to shutdown some launched processes, but that's just the context and shouldn't have any bearing here...)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, a WM_ENDSESSION with wParam==false is simply for information. Prior to receiving this, your application will have received a WM_QUERYENDSESSION. If you did something to get ready to shut down in response to the WM_QUERYENDSESSION, you can un-do it when/if you received a WM_ENDSESSION with wParam=false. If you haven't taken any steps to start shutting down, you can just return 0.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...