I had a need to show the full windows shutdown dialog, screen fadiness and all, from the command line so after much digging I came up with this little snippet.
Code:
GetOrdinalAddress(library,ordinal)
{
handle := DllCall("GetModuleHandle", "str", library, "UInt")
address := DllCall("GetProcAddress", "UInt", handle, "Int", ordinal)
return address
}
hModule := DllCall("LoadLibrary", "str", "Shell32.dll")
DllCall(GetOrdinalAddress("Shell32.dll",60),"Int",0)
DllCall("FreeLibrary","UInt",hModule)
It uses an undocumented shell call to do the dirty work. The GetOrdinalAddress function may be useful for others who wish to use undocumented API calls. Just be sure to load the dll first!