AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Show Windows Shutdown Dialog

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Sat Nov 03, 2007 2:45 am    Post subject: Show Windows Shutdown Dialog Reply with quote

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!
_________________
<enormous animated gif>
Back to top
View user's profile Send private message AIM Address
Sean



Joined: 12 Feb 2007
Posts: 1336

PostPosted: Sat Nov 03, 2007 2:58 am    Post subject: Reply with quote

Actually you don't need LoadLibrary for shell32.dll. BTW, see this:
http://www.autohotkey.com/forum/topic16568.html
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group