Skip to content
⌘ NSIS Forum Archive

Using listboxes in nsDialogs

11 posts

rthawley#

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.
Anders#
The data is per-item hidden data, it is empty unless you set it yourself. Do you want the text of the items?
rthawley#
Yes. Actually I really tried using "SendMessage $VersionListDest ${LB_GETTEXT} 0 $VersionUpdateList" with VersionUpdateList always empty.
rthawley#
using listboxes

Any idea why "SendMessage $VersionListDest ${LB_GETTEXT} 0 $VersionUpdateList" always results with VersionUpdateList always empty?
Anders#
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)'
rthawley#
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
Anders#
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
Anders#
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?
Afrow UK#
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