- NSIS Discussion
- How can i change the COLOR?
Archive: How can i change the COLOR?
jMrX
28th January 2006 13:20 UTC
How can i change the COLOR?
i am using UltramodernUI as skin for my installer. how can i correct the this picture(page).
Thank you!.
This is the code:
; to show the page
Page Custom serialPage serialPageLeave
i know how to call page using !insertmacro but i have no idea to create a custom one same with d picture.
jMrX
29th January 2006 07:33 UTC
this is the Function Code:
serialPage
>!insertmacro MUI_HEADER_TEXT "Enter Serial Code" "Enter the software serial code to continue."
>PassDialog::Dialog Serial
/HEADINGTEXT 'Please enter the serial code ...'
/CENTER
/BOXDASH 12 70 4 ''
/BOXDASH 92 70 4 ''
/BOXDASH 172 70 4 ''
/BOXDASH 252 70 4 ''
/BOX 332 70 4 ''
Pop $R0 # success, back, cancel or error
>FunctionEnd
>Function serialPageLeave
## Pop values from stack
Pop $R0
Pop $R1
Pop $R2
Pop $R3
Pop $R4
## A bit of validation
>StrCmp $R0 'xxxx' +4
StrCmp $R1'xxxx' +3
StrCmp $R2'xxxx' +3
StrCmp $R3'xxxx' +3
StrCmp $R4'xxxx' +3
MessageBox MB_OK
|MB_ICONEXCLAMATION "Invalid Key!"
Abort
## Display the values
>MessageBox MB_OK|MB_ICONINFORMATION "Key Accepted!"
>FunctionEnd
>
jMrX
2nd February 2006 19:13 UTC
Pls Rply to my post i really really nid this next week thanks..
jMrX
3rd February 2006 05:34 UTC
This is The picture pls rply for my post i really really really really need this.. NSIS PROs i need your help pls correct the color! thanks. And if its impossible, just rply your comments or suggestion thanks...
http://http://us.a2.yahoofs.com/grou...Aay4DBbO6NEji0
kichik
3rd February 2006 11:44 UTC
From PassDialog's documentation:
PassDialog::InitDialog /NOUNLOAD [dialog_name] [params]
Pop $HWNDVar
PassDialog::Show
Pop $Var
[dialog_name] : password, userpass, serial, inputbox
$HWNDVar : HWND handle of the window
$Var : success, back, cancel, error
[params] : Described under General Parameters
This method allows you to modify controls on the dialog with
SendMessage, SetCtlColors etc by using the $HWNDVar between
the InitDialog and Show calls, and also in the Page's Leave
function.
Use InitDialog and Show instead of just Dialog and then use SetCtlColors in between.
jMrX
4th February 2006 07:41 UTC
i use your code but my other page turns in to gray color.. why?? how can i insert a MUI CUSTOM PAGE and then i will put my entir script on that. thanks..
Afrow UK
4th February 2006 11:14 UTC
Example:
PassDialog::InitDialog /NOUNLOAD Serial
/HEADINGTEXT 'Please enter the serial code ...'
/CENTER
/BOXDASH 12 70 4 ''
/BOXDASH 92 70 4 ''
/BOXDASH 172 70 4 ''
/BOXDASH 252 70 4 ''
/BOX 332 70 4 ''
Pop $R0 # HWND
GetDlgItem $R1 $R0 1213
SetCtlColors $R1 000000 999999
PassDialog::Show
Pop $R0 # success, back, cancel or error
This will change the colour of the heading text static label (IDC 1213). For a complete list of control ID's open up resource.h in Notepad. For the serial boxes, they start at 1200 incrementing by 1 for each serial box.
Edit: In fact I forgot to mention that the UserPass.nsi example script changes the colour of the user name and password fields.
-Stu
jMrX
4th February 2006 18:12 UTC
i test all the combination but still id didnt work. i want to change the color of the whole dialog and make it similar to the red style color of my MUI PAGE... how can i do that?, im too beginner to Solve the problem so pls help me. thanks...
jMrX
6th February 2006 18:59 UTC
awts no one can help me??? huhuhu so sad.. anyways just post your suggestion what will i do regarding the problem.. thnkxxx
kichik
7th February 2006 18:23 UTC
This will set the background of the dialog to red. You'd probably want to set the same color for th rest of the controls. Use the method exampled in Afrow's post.
PassDialog::InitDialog /NOUNLOAD Serial \
/HEADINGTEXT 'Please enter the serial code ...' \
/CENTER \
/BOXDASH 12 70 4 '' \
/BOXDASH 92 70 4 '' \
/BOXDASH 172 70 4 '' \
/BOXDASH 252 70 4 '' \
/BOX 332 70 4 ''
Pop $R0 # HWND
SetCtlColors $R0 "" ff0000
PassDialog::Show
Pop $R0 # success, back, cancel or error
jMrX
9th February 2006 12:39 UTC
thnksz...