Archive: Background color for controls on custom pages


Background color for controls on custom pages
I want to be able to change the color used on specific controls in a custom dialog page I have. I would think you would be able to do this using some combination of GetDlgItem and SetBkColor however I'm not sure exactly how you do that. My main question is how can you get the HWND of controls in a custom dialog?


For InstallOptions, the dialog item ID is 1200 + Field number - 1. More information about customizing IO control can be found in the Readme.


I forget the post I got this idea from but it is somewhere else in the forum messages. This works...

Push $R0
Push $R1

InstallOptions::initDialog $PLUGINSDIR\HardwareComparisonDialog.ini

Pop $R0
GetDlgItem $R1 $R0 1203 ;1200 + Field number - 1

;$R1 contains the HWND of the first field
SetBkColor $R1 0x00FF00
InstallOptions::show

Pop $R1
Pop $R1
Pop $R0

Thanks for the help Joost.


That's an exact copy from the Readme. Check Contrib\InstallOptions\Readme.html for more info.


You're right it is an exact copy. Can't believe I missed that, aren't I quite the fool.

Thanks again Joost.