Thanks for the reply, it is a user mode application and I know I can prevent shutdown by returning false for WM_QUERYENDSESSION but that keeps the logged in session alive, what I want to do is to run the code during the logoff, effectively after the user has been logged off.
For example, when you a running Windows XP on a domain and you have offline file enabled, you will see the synchronisation window appear during the logoff to sync any remaining files back to the domain controller, I'm trying to achieve something like this. The app does not have to remain a user mode app, it could quite easily become a service if that is required but preventing the logoff is not what I'm trying to achieve.
Thanks for the reply, it is a user mode application
Usermode applications are limited in their ability to delay/prevent shutdown. You are basically limited to what I described in my previous posts. I believe that you have 5 seconds to respond to the WM_QUERYENDSESSION so you might be able to perform some last-second tasks.
For example, when you a running Windows XP on a domain and you have offline file enabled, you will see the synchronisation window appear during the logoff to sync any remaining files back to the domain controller, I'm trying to achieve something like this.
Have you considered using Logon/Logoff[^] or Startup/Shutdown[^] scripts? This is typically what an administrator would use to execute something on shutdown/logoff.
Thanks for the tip, I'll have a look into the scripts and see if they can do what I need. I've just discovered SCM notifications which look promising although I haven't read enough about them to know if they can do what I want yet.
I have created a SDI application with having a LeftView and RightView.LeftView is inherited from CTreeCtrl class where as the rightview is inherited from CFormView class.Can anybody tell me how to split the rightview into 2 halves?
when i run this code , it run but not give me a error message. plz solve my error.
Assuming you mean the opposite of what you wrote - Why don't you just step through the code with the debugger and see where it fails?
Also, next time you post your code please embed it in the "code block" tags.
you can add a TabWnd to the Dialog.
Then you can add a CFormView to this TabWnd.
When you move/resize the TabWnd, you can "hide" the TabWnd and you only see the active CFormView.
Naturally you can switch the View into the TabWnd with another View...
Please check the call stack and see which function in your code causes the problem (and which line). You can then put breakpoints just before the crash location and check if everything is correct (values have correct values, pointers are correctly initialized, ...). If you are still stuck, then post here the call stack with the code (your code) that causes the problem.