Skip to content
⌘ NSIS Forum Archive

Win10 - NsDialog NSDCreate does not push to stack

5 posts

paradoxical#

Win10 - NsDialog NSDCreate does not push to stack

Hi everyone, I have been working with NSIS the past few days, but today I found myself stuck at the following:

This code is generated and ready to use. When I am using $CtlTomcatPortShutdown, $CtlTomcatPortHttp, $CtlTomcatPortHttp, $CtlTomcatServiceName ect. I get returned some random number, instead of the input I want. I have tried more example's from NsDialog document, I am not receiving user input to my script. I run Windows 10 64 bit. I'm completely stuck at the moment.

Here an example:

Function tomcatConfig
!insertmacro MUI_HEADER_TEXT "$(TEXT_CONF_TITLE)" "$(TEXT_CONF_SUBTITLE)"

nsDialogs::Create 1018
Pop $Dialog3

${If} $Dialog3 == error
Abort
${EndIf}

${NSD_CreateLabel} 0 2u 100u 14u "Tomcat shutdown port"
Pop $R0

${NSD_CreateText} 150u 0 50u 12u "8005"
Pop $CtlTomcatPortShutdown
${NSD_SetTextLimit} $CtlTomcatPortShutdown 5
${NSD_CreateLabel} 0 19u 100u 14u "Tomcat default http port"
Pop $R0
${NSD_CreateText} 150u 17u 50u 12u "80"
Pop $CtlTomcatPortHttp
${NSD_SetTextLimit} $CtlTomcatPortHttp 5

${NSD_CreateLabel} 0 36u 100u 14u "Tomcat default https port"
Pop $R0
${NSD_CreateText} 150u 34u 50u 12u "443"
Pop $CtlTomcatPortSSL
${NSD_SetTextLimit} $CtlTomcatPortSSL 5

${NSD_CreateLabel} 0 57u 140u 14u "Tomcat service name"
Pop $R0
${NSD_CreateText} 150u 55u 140u 12u "Servicename"
Pop $CtlTomcatServiceName

${NSD_SetFocus} $CtlTomcatPortShutdown

nsDialogs::Show
FunctionEnd
Anders#
$hCtl_lol_Number1 is not used anywhere in the code you posted so how are we supposed to know what you are talking about? Also please update your stackoverflow question with some information about what "looks invalid" actually means or embed a screenshot.
paradoxical#
Hi Anders, thanks for your reply. I have updated my start post. On SE there was a link to CoolSoft NSIS Dialog Designer which I tried, but gave me the same result. I forgot to change those vars in my start post.

In short, Pop $CtlTomcatServiceName does not get me the servicename that has been put in the textbox, instead I get some random number, 32426235 for instance.
Anders#
It is not a random number, it is the handle (HWND) to the control you just created. Use NSD_GetText to get the text.
paradoxical#
You have no idea how happy I am with the post. And how annoyed I am by missing that one control.. I read the NsDialog document 2 times and still missed it. Thanks alot!!