Jump to content

uxtheme.dll problem


Recommended Posts

Hi,

i have a problem with the switch to the classic theme. my application have to be used in classic skin otherwise the coordinates of the windows doesnt match.

1) Is it possible to read which is the actually theme?

2) my short script below doesnt work. it should switch to classic and load another autoit script but the new script is also winXP theme and not classic :)

anyone can help me?

DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
Run("Sequence.exe")
Link to comment
Share on other sites

Hi! Quick example:

Sequence.exe

If $CmdLine[0] = 0 Then
    MsgBox(64, "Message", "Used XP theme")
Else
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) ; turn off XP themes
EndIf

#include <GuiConstants.au3>

GUICreate("My GUI", 300, 200)

GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

:)

Edited by rasim
Link to comment
Share on other sites

1) Is it possible to read which is the actually theme?

I`m trying, but unsuccessful :)

$NameStruct = DllStructCreate("wchar")
DllStructSetData($NameStruct, 1, 255)

$GetTheme = DllCall("uxtheme.dll", "int", "GetCurrentThemeName", "ptr", DllStructGetPtr($NameStruct), "int", 255, "ptr", 0, "int", 255, "ptr", 0, "int", 255)

MsgBox(0, "", DllStructGetData($NameStruct, 1))
Link to comment
Share on other sites

ok that works thanks.

but i have the problem that i have to switch the window to classic theme from an third party window.

isnt it possible to switch complete to classic theme like when u do yourself.

otherwise if i know the skin name i can say ... ok xpskin -> y + 5 ; alienware skin -> y + 8...

Edited by CosmosTunes
Link to comment
Share on other sites

  • 3 weeks later...

Is it possible to read which is the actually theme?

I know my answer is late, but mayb this need whomever:

$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))

:)

Edited by rasim
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...