Board index » cppbuilder » Problems when Windows Shuting down
Simon Guertin
![]() CBuilder Developer |
Problems when Windows Shuting down2005-11-04 12:18:10 AM cppbuilder90 Hi, The mainform of my application cannot be closed because I use the TTray and I only want my application to be shutdown when I right click on the tray icon. So I overided the OnCloseQuery. But now When Windows shutsdown, I trap the message and it works. BEGIN_MESSAGE_MAP MESSAGE_HANDLER(WM_ENDSESSION, TWMEndSession, WMEndSession) END_MESSAGE_MAP(TForm) But the problem is still there because the OnCloseQuery is called before the WMEndSession. Because of that I cannot change the result of the Onclose Query from the WMEndSession function. Is there a way to work around this? I also noticed that the line TForm::WMEndSession(Message); in the example does not compile. Is there a property that I need to put public in TForm? thank you Simon |