Re: Prevent Windows Shutdown
you can actually CANCEL the shutdown!? no wonder windows security is full of holes :/ sounds like a nice vulnerability for viruses to me, i mean reading that a shutdown is about to happen is useful so you can make your program stop, but cancelling it.. eek..
Although i guess there is always the power button :)
nice post!
Re: Prevent Windows Shutdown
lol :lol: well there was a seemingly valid reason for it, in this post: http://www.vbforums.com/showthread.php?t=378604
Re: Prevent Windows Shutdown
I put that code on my program to test it, then when i ran my program i clicked shutdown and that code didnt cancel it.
Re: Prevent Windows Shutdown
Oh i see i made a error when i tryied out ur code.
Re: Prevent Windows Shutdown
Has anyone tested this in Vista? The last thing I read from MS is that programs like this Don't prevent Vista from shutting down. Vista will give it an allotment of 30 seconds to finish up and then it's terminated regardless. I'm curious if Vista actually does that or not.
Re: Prevent Windows Shutdown
Quote:
Originally Posted by JuggaloBrotha
Has anyone tested this in Vista? The last thing I read from MS is that programs like this Don't prevent Vista from shutting down. Vista will give it an allotment of 30 seconds to finish up and then it's terminated regardless. I'm curious if Vista actually does that or not.
I've tried it, this is what appears:
http://www.vbforums.com/
Re: Prevent Windows Shutdown
It's good to know that MS has included the ability to at least notify you when a program is preventing shut down/ log off
Re: Prevent Windows Shutdown
Does anyone know how to check which window or process sent the "WM_QUERYENDSESSION" message?
I'm trying to determine which process is shutting certain PCs down.
I tried "ex.HWnd", but that returned the current window.
Thanks in advance!
Re: Prevent Windows Shutdown
Quote:
Originally Posted by scotsmanscott
Does anyone know how to check which window or process sent the "WM_QUERYENDSESSION" message?
I'm trying to determine which process is shutting certain PCs down.
I tried "ex.HWnd", but that returned the current window.
Thanks in advance!
You should place that question in the VB.NET forum as a new thread, this is the codebank. You will get more anwsers faster if you do a new thread in the right section.
P.S. Welcome to the forums!