NSD_CreateListBox - not able to get the selected item text
Hi there,
I am using "NSD_CreateListBox" to allow user to select a folder from the given list.
After the user selects an item, I need to fetch the text for that item, but my code fails to do so.
Also, i am using "custom page". Could anyone of you please help?
Here's the code snippet:-
Function nsDialogsPage
nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateLabel} 20 20 100% 50 "Please select the folder to place the iptspy dll file"
${NSD_CreateListBox} 20 80 50% 100 ""
Pop $ListBox
${If} ${FileExists} "$INSTDIR\plugins\*.*"
${GetSize} "$INSTDIR\plugins" "/G=0" $0 $1 $2
StrCpy $searchdir1 "$INSTDIR\plugins"
FindFirst $0 $1 "$searchdir1\*.*"
${Do}
${If} $1 == "."
${OrIf} $1 == ".."
; do nothing
${ElseIf} ${FileExists} "$INSTDIR\plugins\$1\*.*"
${NSD_LB_AddString} $ListBox $1
${Else}
; message
${EndIf}
FindNext $0 $1
${LoopUntil} $1 == ""
FindClose $0
${Else}
; Message box
${EndIf}
nsDialogs::Show
FunctionEnd
Function nsDialogsPageLeave
; get the selected folder text
SendMessage $ListBox ${LB_GETCURSEL} 0 0 $0
${IF} $0 >= 0
;IntOp $1 $0 + 0;
SendMessage $ListBox ${LB_GETTEXT} $1 $0 $2
;System::Call "user32::SendMessage(i $ListBox,i ${LB_GETTEXT},i $1,t. $0)"
;System::Call user32::SendMessage(i$ListBox_left,i${LB_GETTEXT},i$0,t.r1)
MessageBox MB_OK "$2"
${ENDIF}
FunctionEnd
I am able to get the list populated, but not able to get the selected string/text.