Old 13th September 2018, 19:18   #1
dhkom
Junior Member
 
Join Date: Sep 2018
Posts: 2
nsDialogs Listbox - get selected item index

NSD_LB_GetSelection lets me get the selected item text. How can I instead get the selected item index (0 or 1 base doesn't matter). Thanks!
dhkom is offline   Reply With Quote
Old 13th September 2018, 21:25   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,926
PHP Code:
!include nsDialogs.nsh
!ifndef NSD_LB_GetSelectionIndex
!define NSD_LB_GetSelectionIndex `!insertmacro __NSD_LB_GetSelectionIndex `
!
macro __NSD_LB_GetSelectionIndex CONTROL VAR
    
SendMessage ${CONTROL} ${LB_GETCURSEL0 0 ${VAR}
!
macroend
!endif 
I think this has already been added to nsDialogs.nsh in NSIS v3 but I don't remember when nor if it is documented.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 14th September 2018, 14:19   #3
dhkom
Junior Member
 
Join Date: Sep 2018
Posts: 2
Perfect! Thanks!
dhkom is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
nsdialogs listbox

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump