Archive: Newbie help with nsDialogs


Newbie help with nsDialogs
I'm trying to change a custom page dialog after it is displayed. It's not working, and it's probably because I'm not seeing the forest for the trees.

What I'm doing is:

Page custom MyDialog


Function MyDialog
nsDialogs::Create 1018
Pop $hwndDialog
${If} $hwndDialog == error
Abort
${EndIf}
${NSD_CreateText} 0u 0u 300u 140u "My text here"
Pop $hwndText
nsDialogs::Show

${NSD_SetText} $hwndText "Hello world"
SendMessage $hwndText ${EM_SETREADONLY} $0 0
ShowWindow $hwndText ${SW_HIDE}
ShowWindow $hwndText ${SW_SHOW}
FunctionEnd

Can someone point me at what I am doing wrong?


Try

StrCpy $0 "hello world"
SendMessage $hwndText ${WM_SETTEXT} 0 STR:$0


The nsDialogs::Show doesn't return until the user clicks Next. You're changing text on a dialog that is not there anymore.


Page custom MyDialog


Function MyDialog
nsDialogs::Create 1018
Pop $hwndDialog
${If} $hwndDialog == error
Abort
${EndIf}
${NSD_CreateText} 0u 0u 300u 140u "My text here"
Pop $hwndText
${NSD_SetText} $hwndText "Hello world"
SendMessage $hwndText ${EM_SETREADONLY} 1 0

nsDialogs::Show

FunctionEnd