Apart from the InitialSystemShutdown API function,you have ExitWindowEx function. Using this function in Windows 95/98/Me it is easy to shutdown. But in WindowsNT/2000 you need to have the necessary privileges to shutdown the machine! I have seen code in VB that does this. If I remember correct...
In VB you have the "Shell" function which will return the ID of the process created by it. But you seem to want the handle. For details please check MSDN. Its have sample code to illustrate that function.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.