Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: PaiD on July 29, 2005, 03:27 PM

Title: [VB] User Log off
Post by: PaiD on July 29, 2005, 03:27 PM
Ok is this possible?
I have subclassed my app so that I can detect when the User is logging off But the other apps also recieve it. Most of the apps close and when mine gets the message I denied the User logging off. What I wanted to know is is there a way to also tell the other apps not to shutdown?
Title: Re: [VB] User Log off
Post by: Topaz on July 29, 2005, 04:47 PM
I don't believe you can.
Title: Re: [VB] User Log off
Post by: Topaz on August 03, 2005, 10:07 PM
I decided to look it up, and found:

WM_QUERYENDSESSION
Title: Re: [VB] User Log off
Post by: PaiD on August 03, 2005, 11:28 PM
Topaz.... I know that 1. I am using that and I can tell when the user is logging off. My problem is I wanted to tell the other apps open not to close when they get the message and I tell the comp not to log off. I can do all but tell the other apps not to close
Title: Re: [VB] User Log off
Post by: Adron on August 04, 2005, 03:52 AM
Sounds like the other applications are malfunctioning. Delete them from your hard drive.
Title: Re: [VB] User Log off
Post by: Grok on August 04, 2005, 08:37 AM
Quote from: Adron on August 04, 2005, 03:52 AM
Sounds like the other applications are malfunctioning. Delete them from your hard drive.

Haha, evil.

The other programs are running in the context of the logged on user.  When the session ends, the user environment is getting destroyed, and all those programs will close, willingly or by force.

If you want them to continue, either run them as services, or (not sure about this) use RUNAS .. though I think that only affects security context.