Skip to content
⌘ NSIS Forum Archive

Access to the control

4 posts

Kerzh#

Access to the control

Hello to everybody.

I have a custom page with a label.
I want to show this page and THEN to update label, i.e
I make port checking (it takes some time). At the start i want to set label text as "start checking" and when this procedure will be finished i update label to finish.

How can i do this?
Comperio#
First, read the HWND of the control:

; For argument's sake, pretend your label is Field 1...
ReadIniStr $0 "$PLUGINSDIR\YourCustomFile.ini" "Field 1" "HWND"
Once you have the handle to the control, change it's text by using a SendMessage command like this:

SendMessage $0 ${WM_SETTEXT} 0 "STR:new text here"
(make sure you include WinMessages.nsh in your script.)
Afrow UK#
Use it between MUI_INSTALLOPTIONS_INITDIALOG (InstallOptions::InitDialog) and MUI_INSTALLOPTIONS_SHOW (InstallOptions::Show)

-Stu