Old 4th April 2008, 12:42   #1
12700
Junior Member
 
Join Date: Apr 2008
Posts: 2
Question change label text multiple times

Hello NSIS experts,

I'm a newbie to NSIS and have to enhance some existing installer code. There is a page which accepts certain parameters (input from text fields) and manipulates them (when Next is clicked). The error messages generated are shown above the input fields in a Label with red color.

The page uses MUI. Displaying a message in the red Label is not an issue. Code currently is using

code:

GetDlgItem $1 $hwnd 1204 ; PathRequest control (1200 + field 5 - 1)
SendMessage $1 ${WM_SETTEXT} 0 'STR:$0' ;show the message generated by external param checker



The error message on the label will change based on several attempts by user and before displaying each message it would be needed to clear the label. I've tried inserting bunch of \r\n in the label and another attempt was with bunch of spaces. None seem to work. New error message gets overwritten on the previous one.

Please help me by pointing me in the right direction to some samples or at least helping me realize the capabilities of Label type fields.

Thanks and have a good day,
HB
12700 is offline   Reply With Quote
Old 4th April 2008, 13:57   #2
mauvecloud
Junior Member
 
mauvecloud's Avatar
 
Join Date: Mar 2008
Location: Hayward, CA
Posts: 35
I think this is a COM issue more than an NSIS issue, but I am guessing you need to send a message to the parent window so that it redraws the rest of the window, eliminating the leftover text from the previous error message.
mauvecloud is offline   Reply With Quote
Old 4th April 2008, 14:10   #3
12700
Junior Member
 
Join Date: Apr 2008
Posts: 2
Hi folks. I figured it out. In the existing code, I missed the part where the bg color was set to be transparent (with red text) and hence my attempt to put strings with spaces and \r\n were not erasing the previous messages.

This is how it got fixed:
Changed the bg color to be something non transparent and write a "STR:" to that Label. Then changed it back to the desired red text and transparent bg color and write the error message on it.
12700 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