Archive: How to change color of textbox on custom page?


How to change color of textbox on custom page?
  Hello,

is it possible to change the background color of a textbox on a custom page from grey to white?
Here is my ini-File:

***91;Settings***93;

>NumFields=3
State=0

>***91;Field 1***93;
>Type=Label
Left=0
Top=100
Right=-1
Bottom=120
Text=
>State=0
Flags=NOTIFY
HWND=1967168

>***91;Field 2***93;
>Type=text
Left=0
Top=10
Right=-1
Bottom=90
Text=
>State=""
>Flags=MULTILINE|VSCROLL|READONLY
HWND=4719720

>***91;Field 3***93;
>Type=Checkbox
Left=0
Top=125
Right=-1
Bottom=135
Text=Ignore
State=1
Flags=NOTIFY
HWND=1508582
>
and here is my code of showCustomPage:

showCheckSummary

>!insertmacro MUI_HEADER_TEXT "Environment errors" "The following environment checks failed."

>;if no errors were found go to done else goto notEqual
strcmp$9 "false" done notEqual
notEqual:
writeinistr "checkSummary.ini" "FIELD 3" "State" "0"
;disable next button
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0

writeinistr "checkSummary.ini" "FIELD 2" "State" "$ERROR_MESSAGE"

;changeColor of textbox from grey to white
ReadINIStr "$0" "checkSummary.ini" "FIELD 2" "HWND"
strcpy $0 "4719720"
GetDlgItem $0 $HWNDPARENT 1
SetCtlColors$0 0xFF00FF 0x00FFFF

InstallOptions
::InitDialog /NOUNLOAD "checkSummary.ini"
InstallOptions::Show 'checksummary.ini'

>done:

>FunctionEnd
>
I tried it but somethong goes wrong...
Where is the mistake?

Thanks...

ReadINIStr "$0" "checkSummary.ini" "FIELD 2" "HWND"
SetCtlColors $0 0xFF00FF 0x00FFFF

-Stu


hm,
ok I tried it, but it does not work.
I pasted the two lines before


InstallOptions::InitDialog /NOUNLOAD "checkSummary.ini" 

and deleted the others but the textbox is still grey...
ReadIniString returns the correct value.

add the code between the 2 plugin calls e.g.

  InstallOptions::InitDialog /NOUNLOAD "checkSummary.ini"

ReadINIStr "$0" "checkSummary.ini" "FIELD 2" "HWND"
SetCtlColors $0 0xFF00FF 0x00FFFF

InstallOptions::Show 'checksummary.ini'


and use either the mui macro system to read/write the ini and call the plugin, or you need to type "$PLUGINSDIR\checkSummary.ini" every time.