- NSIS Discussion
- license page - license display
Archive: license page - license display
superwan
10th February 2005 17:45 UTC
license page - license display
hello ;)
there are some things I don't like in the display box of my license.rtf ;)
1) the default background should be the white in the next nsis version, it's better (in my opinion)
2) there is a mouse cursor in this page...
I wanted to know if it is possible to disable it
it would be more beautiful
3) I did'nt manage to center some lines (like the title) in the box... is it possible ?
and how ?
thx for your answers, guys ;)
kichik
10th February 2005 20:55 UTC
- It's never a good idea to enforce just background or foreground color without enforcing the other one. What if the default text color is white too?
- Why disable the mouse cursor? How will you be able to click the "I Agree" button?
- Open your RTF in Word or Write and center the line. You should do that from the Paragraph menu option.
superwan
10th February 2005 22:49 UTC
thx for your answers kichik !
2. no, you didn't understand me ;)
look in the text box of the licence...
there is a flickering cursor... like the cursor when you're writing in a text which shows where you're writing... not this from the mouse... do you understand ? (it's not easy in english :p )
3. the command center does not work in a rtf, just try it ;)
kichik
10th February 2005 22:56 UTC
The text cursor is nice to have. You can copy parts of the license with it.
Centering in a RTF works fine for me. See the attached file for an example.
superwan
10th February 2005 23:38 UTC
well sorry, it does work with wordpad, not with ms word
thx for your example and the attached file :D
I don't want this text cursor...
do you know any way to deactivate it ?
I couldn't find it with winspy++... :L
kichik
10th February 2005 23:59 UTC
I can't think of a way to disable the text cursor.
DrO
11th February 2005 00:14 UTC
http://msdn.microsoft.com/library/de.../hidecaret.asp and a bit of system plugin use i think will sort it (don't know 100% though and i can't test myself at the moment)
-daz
superwan
11th February 2005 00:32 UTC
this is a bit too hard for me...
if somebody could give me a few explanation :)
thx ;)
kichik
11th February 2005 11:22 UTC
Get the HWND of the license text box in the show function of the license page and use:
# assuming $0 holds the HWND
System::Call "user32::HideCaret(i $0)"
superwan
12th February 2005 01:02 UTC
waoh thank you for this line of code :)
but I still don't manage to get the hwnd :L
this working script doesn't disable the text cursor :
!include "MUI.nsh"
Name "test page de licence"
OutFile "test.exe"
LicenseBkColor FFFFFF
!define MUI_PAGE_CUSTOMFUNCTION_show "license_show"
!insertmacro MUI_PAGE_LICENSE "gpl.rtf"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "French"
Section
SectionEnd
Function license_show
FindWindow $R0 "#32770" "" $HWNDPARENT
System::Call "user32::HideCaret(i $R0)"
FunctionEnd
kichik
12th February 2005 01:09 UTC
You need to use GetDlgItem after FindWindow. FindWindow only finds the inner dialog. The text control is in that inner dialog, so you must use GetDlgItem to get its HWND. Use Resource Hacker on an installer to get the id of the text control. You can also take a look at the source (namely resource.h and Ui.c).
superwan
12th February 2005 01:25 UTC
ok ok
thx
I'll have a look at it tomorrow, I'm too tired this evening
but this is nice of you :)
thank you encore une fois :)
superwan
12th February 2005 02:03 UTC
this code :
!include "MUI.nsh"
Name "test page de licence"
OutFile "test.exe"
LicenseBkColor FFFFFF
!define MUI_PAGE_CUSTOMFUNCTION_show "license_show"
!insertmacro MUI_PAGE_LICENSE "gpl.rtf"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "French"
Section
SectionEnd
Function license_show
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1000
System::Call "user32::HideCaret(i $R1)"
FunctionEnd
doesn't work :L
I'm sur the command getdlgitem is good
with winspy++, I found the window containing the text of the licence, and its control id is in decimal "1000"
where am I wrong ?
kichik
12th February 2005 10:57 UTC
Verify you've got the right HWND using something like ShowWindow with ${SW_HIDE}. If the text control hides, you can be sure you've got the right HWND. You can also be sure HideCaret doesn't do what you want in this case :(