[英]How to change custom page label text on the fly in nsis?
I have written a custom page where i want to change the label text on the fly .I tried following code but some how I could not bale to change the text . 我写了一个自定义页面,我想在其中动态更改标签文本。我尝试了以下代码,但是有些方法无法打包来更改文本。
Function Maintainance
nsDialogs::Create 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 12u "The $CurrentVersion complete installation folder is available at the below link"
Pop $Label
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1006
SendMessage $1 ${WM_SETTEXT} 0 "STR:new value 111111"
nsDialogs::Show
FunctionEnd
Any pointer on this will be a help. 任何对此的指点都会有所帮助。
The custom page is not visible until you call nsDialogs::Show. 在调用nsDialogs :: Show之前,自定义页面不可见。 Any dynamic action has to happen after that with a timer or in response to a user action:
之后必须使用计时器或响应用户操作来进行任何动态操作:
Page Custom MyPageCreate
Page InstFiles
!include nsDialogs.nsh
var mylabel
Function MyPageCreate
nsDialogs::Create 1018
Pop $0
${NSD_CreateLabel} 0 0 100% 12u "Hello"
Pop $mylabel
${NSD_CreateButton} 0 50% 50% 12u "Change"
Pop $0
${NSD_OnClick} $0 ChangeIt
nsDialogs::Show
FunctionEnd
Function ChangeIt
System::Call kernel32::GetTickCount()i.r0
SendMessage $mylabel ${WM_SETTEXT} 0 "STR:World! $0"
FunctionEnd
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.