Old 31st January 2007, 13:05   #1
Marcus1807
Junior Member
 
Join Date: Jan 2007
Posts: 8
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:
PHP Code:
[Settings]
NumFields=3
State
=0

[Field 1]
Type=Label
Left
=0
Top
=100
Right
=-1
Bottom
=120
Text
=
State=0
Flags
=NOTIFY
HWND
=1967168

[Field 2]
Type=text
Left
=0
Top
=10
Right
=-1
Bottom
=90
Text
=
State=""
Flags=MULTILINE|VSCROLL|READONLY
HWND
=4719720

[Field 3]
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:
PHP Code:
Function showCheckSummary
 
!insertmacro MUI_HEADER_TEXT "Environment errors" "The following environment checks failed."
 
 
;if no errors were found go to done else goto notEqual
 strcmp 
$"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 $"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...
Marcus1807 is offline   Reply With Quote
Old 31st January 2007, 14:24   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
ReadINIStr "$0" "checkSummary.ini" "FIELD 2" "HWND"
SetCtlColors $0 0xFF00FF 0x00FFFF

-Stu
Afrow UK is offline   Reply With Quote
Old 31st January 2007, 14:31   #3
Marcus1807
Junior Member
 
Join Date: Jan 2007
Posts: 8
hm,
ok I tried it, but it does not work.
I pasted the two lines before

PHP Code:
InstallOptions::InitDialog /NOUNLOAD "checkSummary.ini" 
and deleted the others but the textbox is still grey...
ReadIniString returns the correct value.
Marcus1807 is offline   Reply With Quote
Old 31st January 2007, 15:12   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
add the code between the 2 plugin calls e.g.
code:
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump