Thanks strongm, I was not aware of that. Anyway, I changed my mind. I have added a modal password form in the Form_QueryUnload event. I am not even checking UnloadMode. It is working fine, just some programs are closed but not mine!!!
Thank you everybody.
Thanks, I had thought of this method earlier. Then I switched to sub-classing because we can intercept the messages of any window (not only our application). So if we can retrieve the handle of any system window that receives the message on the earliest my problem can be solved.
I tried...
I want my application to be always running. I have included password so that if someone tries to close the application, it will ask for password. Now I am trying to prevent windows from shutting down, restart or logging off while my application is running. Whenever it happens, my application...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.