Running a .Net app before logoff

G

Guest

Hi
I have a small .net Windows app that I need to run before the user logs off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that windows
logs off before running the .exe and when it runs the .exe you can no longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?
 
M

Mr. Arnold

fhunter said:
Hi
I have a small .net Windows app that I need to run before the user logs
off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other
words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that
windows
logs off before running the .exe and when it runs the .exe you can no
longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?

So why can't you have a solution that's a Windows solution, that has no
form, no user interactions and not an console application?

That type of solution can be called when the user logs off and it won't
hang.
 
R

Rad [Visual C# MVP]

You might be able to do it "backwards".

I just read your post and what if you tried something like this:
http://www.eggheadcafe.com/tutorial...8834-04366ce32c96/net-lock-logoff-reboot.aspx

and actually lock out the "log off" till after they run your program. -
then you enable the logoff.

Just a thought

Im too much of a newbie in .net to help any more - sorry.

Miro

Interesting idea ... but shutdown can be achieved through other means.
Like command line.

There should be a windows message that gets sent when the system is
shutting down that you can trap
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top