Archive: Apply Windows Theme


Apply Windows Theme
i did a little research on msdn and google, but couldn't get any helpful information. what i'm trying to do is to install and apply a theme for windows xp (i.e. $WINDIR\Resources\Themes\Windows Classic.theme).

when you do it over the registry, the theme won't be installed until next reboot. i'm not sure if one can install it using anything related to rundll32.exe shell32.dll,Control_RunDLL desk.cpl without pressing an extra button (OK or Apply) to apply it.

there might be a system-call, but i couldn't find anything (this might be a hint).

can anyone help me?


i know this has to be possible style xp does it and ive seen a self extracting copy of windows 3000 theme somewhere at one point that did it too.


http://msdn.microsoft.com/library/de...x/refentry.asp


But I think easy to use:

ExecShell "open" "$WINDIR\Resources\Themes\Windows Classic.theme"

Instructor,

that just brings up the dialog to change the theme it doesnt actually apply it


that just brings up the dialog to change the theme it doesnt actually apply it
I know. See link above.

is it SetWindowTheme to use or do you suggest using ExecShell and CloseThemeData?


Yathosho, you can use API or ExecShell.

I tried to write a code, but have faced a problem with API - $1 is NULL:

System::Call 'user32::GetDesktopWindow()i .r0'
System::Call 'uxtheme::OpenThemeData(i r0, t L"StartPanel")i .r1'

Try this:

Name "ChangeStyleXP"
OutFile "ChangeStyleXP.exe"

!include "FileFunc.nsh"
!insertmacro GetFileName

!define BM_CLICK 0x00F5
!define WM_CLOSE 0x0010

Section
IfFileExists "$WINDIR\Resources\Themes\Windows Classic.theme" 0 error
ExecShell 'open' '$WINDIR\Resources\Themes\Windows Classic.theme'
FindWindow $0 '#32770' '' $HWNDPARENT
StrCpy $3 0

wait:
IntOp $3 $3 + 1
StrCmp $3 50 error
Sleep 100
System::Call 'user32::GetForegroundWindow()i .r1'
StrCmp $0 $1 wait

System::Call 'user32::GetWindowModuleFileName(i r1, t .r2, i ${NSIS_MAX_STRLEN})'
${GetFileName} '$2' $2
StrCmp $2 'comctl32.dll' 0 wait

HideWindow
GetDlgItem $2 $1 1
SendMessage $2 ${BM_CLICK} 0 0
MessageBox MB_OK "Success" IDOK quit

error:
MessageBox MB_OK "Error"

quit:
quit
SectionEnd
Script use header

now that works thanks ive been looking for that myself


you should post that in the archive