AutoHotkey Community

It is currently May 27th, 2012, 8:10 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Fetch windows theme
PostPosted: January 3rd, 2012, 3:56 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Happy new year AutoHotkey! I wonder what great things will be done with with AutoHotkey 2012??? :D

Anyone know how to get the name of the current Windows theme in use?
Might be a job for DllCall(), but not 100% sure...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2012, 12:28 pm 
Offline

Joined: July 10th, 2008, 8:49 am
Posts: 1865
Location: Brussels, Belgium
Piece of cake (scroll down to get the syntax and the dll file) :

http://msdn.microsoft.com/en-us/library ... 02(v=vs.85).aspx (copy/paste the link as the html wrapper screw the URL when there is ( ) in it).

So you can do it with a DllCall if you know how it works. ;-)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2012, 6:36 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Thanks for that, but what i needed was a way to find the name of theme in use but without knowing the theme file path.

Anyway, i found it in the registry (don't know why didn't think of that before)

And in case i might want to use it in other scripts, i put it into a function... 8)
Code:
GetWindowsTheme()
{
  RegRead, fileTheme, HKEY_CURRENT_USER, Software\Microsoft\Plus!\Themes\Current      ;eg  %SystemRoot%\resources\1033\Nature.Theme

  SystemRoot = C:\WINDOWS
  Transform, fileTheme, Deref, %fileTheme%                                             ;eg  C:\WINDOWS\resources\1033\Nature.Theme

  Loop, %fileTheme%
    name_ext := A_LoopFileName                                                         ;eg  Nature.Theme

  StringTrimRight, usedTheme, name_ext, 6         ;rid trailing ".Theme"               ;eg  Nature

  return usedTheme
}


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, migz99 and 67 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