Tony Cappellini wrote:
I would like to write a simple program so I can initiate a Shutdown (power
off), Restart, or Switch User.
Would someone point to the API's that I need to do this?
You can do a shutdown or reboot with win32api.ExitWindowsEx.
To switch users, use
Hi guys,
I've got this little yellow icon sitting in my system tray:
http://i7.tinypic.com/21n08ig.png
I'd like to use the windows API to somehow ask it to shutdown? If a
system tray icon counts as a window then perhaps I could get its hwnd
and do something like:
win32gui.PostMessage(hwnd,
Ok I figured out how to do it:
Here's the code I made mostly from copying the examples. If anyone
could tell me how the code works, that would still be appriciated, for
example why/how do I need this function _MyCallback?
-Greg
My code:
import sys
import win32process, win32api, win32pdhutil,