Archive: How to change the color of the buttons


How to change the color of the buttons
Hello,

I would like to color the buttons on my pages (WELCOME and Custom), I don't found anything about this. I just red something about SubClass but didn't understand what does it mean.

Is there anyone to explain me how to do that ?

Thank you so much


I found a solution :

See Example_MUI.nsi in the Examples\skinnedbutton directory

_ First, in the .onInit function, extract the button bitmap:

Function .onInit

InitPluginsDir

File "/oname=$PLUGINSDIR\button.bmp" \
"${NSISDIR}\Contrib\skinnedbutton\skins\ishield.bmp"

FunctionEnd

_ Second, create a function, for example, named myGUIInit

Function myGUIInit

skinnedbutton::skinit /NOUNLOAD "$PLUGINSDIR\button.bmp"

Pop $0

StrCmp $0 "success" noerror

MessageBox MB_ICONEXCLAMATION|MB_OK "skinned button error: $0"

noerror:

FunctionEnd

And add this line before the insertion of macro page.

!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit

_ Third, in the .onGUIEnd function, it is time to kill the plugin.

Function .onGUIEnd

skinnedbutton::unskinit

FunctionEnd

_ It's the same thing for the uninstaller:

Function un.onInit

InitPluginsDir

File "/oname=$PLUGINSDIR\button.bmp" \
"${NSISDIR}\Contrib\skinnedbutton\skins\ishield.bmp"

FunctionEnd

create an uninstall function, for example, named un.myGUIInit

Function un.myGUIInit

skinnedbutton::skinit /NOUNLOAD "$PLUGINSDIR\button.bmp"

Pop $0

StrCmp $0 "success" noerror

MessageBox MB_ICONEXCLAMATION|MB_OK "skinned button error: $0"

noerror:

FunctionEnd

And add this line before insert macro page.

!define MUI_CUSTOMFUNCTION_UNGUIINITun. myGUIInit

Function un.onGUIEnd

skinnedbutton::unskinit

FunctionEnd

_ Finally, Don't forget to add the "XPStyle off" instruction after the insertion of macro page. Otherwise, no buttons will appear.

_ That's all!


But I have a problem with the command skinnedbutton::skinit