Old 26th July 2019, 11:16   #1
Junior Member
Join Date: Jul 2019
Posts: 30
How to dynamically update a label text on the fly


I have a label under which I am showing a progress bar. I need to display "Validation success " in the label after successful validation or else "Validation failed" .

Below is the code snippet

${NSD_CreateLabel} 0.09u 5.54u 102.03u 14.5u "Validating process"

${NSD_CreateProgressBar} 0.09u 21.54u 100% 10% ""
Pop $hwnd
${NSD_AddStyle} $hwnd ${PBS_MARQUEE}

${NSD_CreateTimer} StartValidation 1000

Function StartValidation

${NSD_KillTimer} StartValidation
Call Validate
${If} ${Errors}
SendMessage $myLabel ${WM_SETTEXT} 0 "Failed"
SendMessage $myLabel ${WM_SETTEXT} 0 "Success"
SendMessage $hwnd ${PBM_SETMARQUEE} 0 0
DivyaArun is offline   Reply With Quote
Old 26th July 2019, 11:19   #2
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
Sending a string in a message requires the STR: prefix

SendMessage $whatever ${WM_SETTEXT} 0 "STR:Hello"
You can also use the NSD_SetText macro.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
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