[Console Application] Event when user logout/shutdown windows?

Hi,

I need my console application to execute a last command when a user logout or shutdown windows.

Is there a way to catch those events? or is there a specific event when windows try to close your application (you logout => windows want to close everything including your app). I found such thing for a windows form but not for a console application ...

Thanks for your help.

N.

[414 byte] By [Nico_M] at [2007-12-24]
# 2

I've been looking at this and it doesn't seem possible.

I tried getting various process info, but that doesn't work. And Jared's link specifically says:

Important:

Console applications do not raise the SessionEnding event.

There doesn't seem to be a way to "see" a console app close unless it happens via the app's own code.

rkimble at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 3

thanks for your answer !

You confirm what i found ... ><

i'll guess i'll try with a window application !

Nico_M at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Language...