Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
U

User 888993

@User 888993
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WM_QUERYENDSESSION problem on C++ Builder 2010
    U User 888993

    ARopo wrote:

    I had a simular problem and had to check for 2 messages WM_ENDSESSION or WM_QUERYENDSESSION. Then set a flag to indicate shutdown, this flag was then used in an OnClosing event that by default cancelled the close to minimize to the system tray

    Thank you for your answer. Hovewer your suggestion will not work in my case as WM_ENDSESSION is calling Application->Termiante() which terminates program even if the flag in OnClose event is set to hide or none and the application is minimized to the systray. Calling Application->Termiante() by WM_ENDSESSION (even if application returns zero to WM_QUERYENDSESSION message) is recent bug of C++ Builder 2010. Previous versions of the compiler worked properly and did not call Application->Termiante() if application returned zero to WM_QUERYENDSESSION message. Does anybody know how to fix or bypass this bug of the C++ Builder 2010?

    C / C++ / MFC help c++ tutorial question

  • WM_QUERYENDSESSION problem on C++ Builder 2010
    U User 888993

    I have the following code: .... private: void __fastcall WMQueryEndSession(TWMQueryEndSession& Message); BEGIN_MESSAGE_MAP MESSAGE_HANDLER(WM_QUERYENDSESSION, TWMQueryEndSession, WMQueryEndSession) END_MESSAGE_MAP(TForm) ..... void __fastcall TForm1::WMQueryEndSession(TWMQueryEndSession & Message) { Message.Result=0; } Compiled by C++ Builder 2010, the code works improperly. Although it prevents the computer from shut down, but it also closes my application. The code below fixes the problem, but it is not stable (sometimes does not work) and the such long delay in 10 seconds is not acceptable in my case: void __fastcall TForm1::WMQueryEndSession(TWMQueryEndSession& Message) { Sleep(10000); Message.Result=0; } Does enybody know how to fix the problem? Thanks.

    C / C++ / MFC help c++ tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups