Announcement

Collapse
No announcement yet.

Apply Windows Theme

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?
    NSIS IDE for Atom | NSIS for Visual Studio Code | NSIS for Sublime Text | NSIS.docset

  • #2
    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.

    Comment


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


      But I think easy to use:
      code:
      ExecShell "open" "$WINDIR\Resources\Themes\Windows Classic.theme"
      my functions

      Comment


      • #4
        Instructor,

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

        Comment


        • #5
          that just brings up the dialog to change the theme it doesnt actually apply it
          I know. See link above.
          my functions

          Comment


          • #6
            is it SetWindowTheme to use or do you suggest using ExecShell and CloseThemeData?
            NSIS IDE for Atom | NSIS for Visual Studio Code | NSIS for Sublime Text | NSIS.docset

            Comment


            • #7
              Yathosho, you can use API or ExecShell.

              I tried to write a code, but have faced a problem with API - $1 is NULL:
              code:
              System::Call 'user32::GetDesktopWindow()i .r0'
              System::Call 'uxtheme::OpenThemeData(i r0, t L"StartPanel")i .r1'

              my functions

              Comment


              • #8
                Try this:
                code:
                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
                my functions

                Comment


                • #9
                  now that works thanks ive been looking for that myself

                  Comment


                  • #10
                    you should post that in the archive

                    Comment

                    Working...
                    X
                    😀
                    🥰
                    🤢
                    😎
                    😡
                    👍
                    👎