Sunday, May 1, 2011

preventing vista shutdown loggoff API showing

I want to stop the shutdown / log off API which appears when you have programs open to confirm a shutdown/logoff.

I have an application already that send a reason to the API.

I know this is bad practice but I really need to override / cancel the shutdown with out displaying the API after 5 seconds.

is there any way to hack this or run a custom shutdown script to override the shutdown.

thanks in advance

From stackoverflow
  • You may want to look at this: http://msdn.microsoft.com/en-us/library/aa376871(VS.85).aspx

    When I did this functionality I had to do everything in unmanaged C++ as I had problems trying to set the priviledge by using Interop.

    You need this flag: EWX_FORCE in ExitWindowsEx.

    James Black : Cancel your own thing, or just catch the event and then do your own thing, knowing that the shutdown will happen. Unfortunately, in my experience, if they press the power button there is nothing you can really do, as they can hold it for five seconds and all you can do later is clean up.
  • it doesnt matter about holding it for5 seconds just catching it if it is pressed once. I can do that but vista shows a API screen after 5 seconds which All i want is vista not to show that.

    vista shows that because I prevent it from shutting down.

0 comments:

Post a Comment