Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 5th June 2012, 20:24   #1
rthawley
Junior Member
 
Join Date: Jun 2012
Posts: 6
Using listboxes in nsDialogs

How do I get a list of items in a listbox? I have tried "SendMessage $VersionListDest ${LB_GETITEMDATA} 0 $VersionUpdateList" and I get back a empty string in VersionUpdateList.
rthawley is offline   Reply With Quote
Old 5th June 2012, 21:00   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
The data is per-item hidden data, it is empty unless you set it yourself. Do you want the text of the items?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th June 2012, 21:27   #3
rthawley
Junior Member
 
Join Date: Jun 2012
Posts: 6
Yes. Actually I really tried using "SendMessage $VersionListDest ${LB_GETTEXT} 0 $VersionUpdateList" with VersionUpdateList always empty.
rthawley is offline   Reply With Quote
Old 7th June 2012, 17:45   #4
rthawley
Junior Member
 
Join Date: Jun 2012
Posts: 6
using listboxes

Any idea why "SendMessage $VersionListDest ${LB_GETTEXT} 0 $VersionUpdateList" always results with VersionUpdateList always empty?
rthawley is offline   Reply With Quote
Old 7th June 2012, 18:43   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
A NSIS variable is not the address of a C string buffer, try System::Call 'user32::SendMessage(i$VersionListDest,i${LB_GETTEXT},i 0,t.r1)'

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 8th June 2012, 20:49   #6
rthawley
Junior Member
 
Join Date: Jun 2012
Posts: 6
Using listboxes in nsDialogs

That doesn't work either. Below is my code, is something still wrong?


nsDialogs::Show

System::Call user32::SendMessage(i$VersionListDest,i${LB_GETTEXT},i 0,t.r1)

MessageBox MB_OK $r1
rthawley is offline   Reply With Quote
Old 8th June 2012, 21:41   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
t.r1 == $1. You are using $R1 in your message box.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 23rd June 2012, 18:17   #8
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 676
a listbox is part of a ini file - you can read it out and separate the values otherwise.
Brummelchen is offline   Reply With Quote
Old 23rd June 2012, 21:03   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
Quote:
Originally Posted by Brummelchen View Post
a listbox is part of a ini file - you can read it out and separate the values otherwise.
The question is about nsDialogs, not InstallOptions

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 23rd June 2012, 21:04   #10
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,779
Quote:
Originally Posted by rthawley View Post
That doesn't work either. Below is my code, is something still wrong?


nsDialogs::Show

System::Call user32::SendMessage(i$VersionListDest,i${LB_GETTEXT},i 0,t.r1)

MessageBox MB_OK $r1
Does the control even exist after nsDialogs::Show returns?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 25th June 2012, 21:20   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Ah yes you can't handle the controls after ::Show returns because at that point they have all been destroyed. You have to do it in the page's leave callback function.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

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