AutoHotkey Community

It is currently May 25th, 2012, 8:35 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: November 3rd, 2007, 2:45 am 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
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>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2007, 2:58 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Actually you don't need LoadLibrary for shell32.dll. BTW, see this:
http://www.autohotkey.com/forum/topic16568.html


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Learning one, Relayer, Yahoo [Bot] and 5 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group