Jump to content

how can i get the current windows 7 theme file(*.theme) i use?


Guest
 Share

Recommended Posts

hello,

i want that my script will Identify the activated theme file(*.theme) that windows 7 using..

how can i do that?

thanks for helpers!

Link to comment
Share on other sites

Like this?

#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)
Global Const $SZ_THDOCPROP_CANONICALNAME = 'ThemeName'
Global $Data = _WinAPI_GetCurrentThemeName()

If IsArray($Data) Then
    ConsoleWrite('Name:    ' & $Data[0] & @CR)
    ConsoleWrite('Name:    ' & _WinAPI_GetThemeDocumentationProperty($Data[0], $SZ_THDOCPROP_CANONICALNAME) & @CR)
EndIf

saludos

Edited by Danyfirex
Link to comment
Share on other sites

Hi,

After some search in the forum :

$Struct = DllStructCreate("wchar File[255];wchar Color[255];wchar Size[255]")

$GetTheme = DllCall("UxTheme.dll", "int", "GetCurrentThemeName", "ptr", DllStructGetPtr($Struct, "File"), "int", 255, "ptr", DllStructGetPtr($Struct, "Color"), "int", 255, "ptr", DllStructGetPtr($Struct, "Size"), "int", 255)

If DllStructGetData($Struct, 1) = "" Then
    MsgBox(64, "Message", "Current theme is classic")
    Exit
EndIf

MsgBox(64, "Message", "Theme file: " & DllStructGetData($Struct, 1) & @LF & @LF & _
       "Color scheme: " & DllStructGetData($Struct, 2) & @LF & @LF & _
       "Font size: " & DllStructGetData($Struct, 3))

source : '?do=embed' frameborder='0' data-embedContent>>

Link to comment
Share on other sites

Hi,

After some search in the forum :

$Struct = DllStructCreate("wchar File[255];wchar Color[255];wchar Size[255]")

$GetTheme = DllCall("UxTheme.dll", "int", "GetCurrentThemeName", "ptr", DllStructGetPtr($Struct, "File"), "int", 255, "ptr", DllStructGetPtr($Struct, "Color"), "int", 255, "ptr", DllStructGetPtr($Struct, "Size"), "int", 255)

If DllStructGetData($Struct, 1) = "" Then
    MsgBox(64, "Message", "Current theme is classic")
    Exit
EndIf

MsgBox(64, "Message", "Theme file: " & DllStructGetData($Struct, 1) & @LF & @LF & _
       "Color scheme: " & DllStructGetData($Struct, 2) & @LF & @LF & _
       "Font size: " & DllStructGetData($Struct, 3))

source : '?do=embed' frameborder='0' data-embedContent>>

 

same as >#2

Link to comment
Share on other sites

Like this?

#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)
Global Const $SZ_THDOCPROP_CANONICALNAME = 'ThemeName'
Global $Data = _WinAPI_GetCurrentThemeName()

If IsArray($Data) Then
    ConsoleWrite('Name:    ' & $Data[0] & @CR)
    ConsoleWrite('Name:    ' & _WinAPI_GetThemeDocumentationProperty($Data[0], $SZ_THDOCPROP_CANONICALNAME) & @CR)
EndIf

saludos

 

thanks but your code is not working..

i get this error:

==> Error opening the file.:

#Include <WinAPIEx.au3>

 

Hi,

After some search in the forum :

$Struct = DllStructCreate("wchar File[255];wchar Color[255];wchar Size[255]")

$GetTheme = DllCall("UxTheme.dll", "int", "GetCurrentThemeName", "ptr", DllStructGetPtr($Struct, "File"), "int", 255, "ptr", DllStructGetPtr($Struct, "Color"), "int", 255, "ptr", DllStructGetPtr($Struct, "Size"), "int", 255)

If DllStructGetData($Struct, 1) = "" Then

MsgBox(64, "Message", "Current theme is classic")

Exit

EndIf

MsgBox(64, "Message", "Theme file: " & DllStructGetData($Struct, 1) & @LF & @LF & _

"Color scheme: " & DllStructGetData($Struct, 2) & @LF & @LF & _

"Font size: " & DllStructGetData($Struct, 3))

source : '?do=embed' frameborder='0' data-embedContent>>

thanks but it does not return the correct answer.

the correct answer in my case is:

C:UsersGilAppDataLocalMicrosoftWindowsThemes1 (2).theme

Link to comment
Share on other sites

You need #Include <WinAPIEx.au3> UDF, instead You can use Autoit Beta.

Link to comment
Share on other sites

You need #Include <WinAPIEx.au3> UDF, instead You can use Autoit Beta.

ok i did it.

now it is working but it does not return the correct answer.

it return this:

Name:    C:WindowsresourcesThemesAeroAero.msstyles

Name:    Aero

i need that it will return the theme file..

this is what it shuld return in my case:

C:UsersGilAppDataLocalMicrosoftWindowsThemes1 (2).theme

Link to comment
Share on other sites

i got it!!

this is the code:

RegRead("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionThemes", "CurrentTheme")

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...