Yathosho
19th May 2005 22:34 UTC
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?
ZmAn3
20th May 2005 08:39 UTC
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.
Instructor
20th May 2005 08:56 UTC
http://msdn.microsoft.com/library/de...x/refentry.asp
But I think easy to use:
ExecShell "open" "$WINDIR\Resources\Themes\Windows Classic.theme"
ZmAn3
20th May 2005 09:15 UTC
Instructor,
that just brings up the dialog to change the theme it doesnt actually apply it
Instructor
20th May 2005 09:58 UTC
that just brings up the dialog to change the theme it doesnt actually apply it
I know. See link above.
Yathosho
20th May 2005 14:15 UTC
is it SetWindowTheme to use or do you suggest using ExecShell and CloseThemeData?
Instructor
21st May 2005 09:35 UTC
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'
Instructor
21st May 2005 12:37 UTC
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
ZmAn3
22nd May 2005 06:31 UTC
now that works thanks ive been looking for that myself
ZmAn3
23rd May 2005 01:03 UTC
you should post that in the archive