WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Custom dropdown menu to show contents of a directory
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
Ivan Andreevich
Junior Member

Registered: Nov 2003
From: Vancouver, BC

Wink Custom dropdown menu to show contents of a directory

First, I am using nsDialogs to select a folder.

Next, I need to make a dropdown menu which would load the list of all the directories from the folder above and let the user select one of them.

Any suggestions?

Quick Link | Report this post to a moderator | IP: Logged

Ivan Andreevich is offline Old Post 12-10-2008 06:37 PM
Click Here to See the Profile for Ivan Andreevich Click here to Send Ivan Andreevich a Private Message Click Here to Email Ivan Andreevich Find more posts by Ivan Andreevich Add Ivan Andreevich to your buddy list Edit/Delete Message Reply w/Quote
Animaether
Major Dude

Registered: Jun 2001
From:

Use FindFirst, FindNext and FindClose to get the file entries in that folder, use IfFileExists "<root><found file entry>\*.*" for each found file entry to check if it's a folder, add to dropdown list items as you go.

If you want the results to be sorted, I'd recommend using NSISList or NSISArray as they have built-in sorting functions.

Here's an example of finding the dirs in the first place..

code:
FindFirst $0 $1 "c:\*.*" _loop: StrCmp $1 "" _done IfFileExists "c:\$1\*.*" 0 _next MessageBox MB_OK "[$1]" _next: FindNext $0 $1 goto _loop _done: FindClose $0

Quick Link | Report this post to a moderator | IP: Logged

Animaether is offline Old Post 12-11-2008 07:47 AM
Click Here to See the Profile for Animaether Click here to Send Animaether a Private Message Find more posts by Animaether Add Animaether to your buddy list Edit/Delete Message Reply w/Quote
Ivan Andreevich
Junior Member

Registered: Nov 2003
From: Vancouver, BC

Great help, thanks. I'll see where I can get with that.

Quick Link | Report this post to a moderator | IP: Logged

Ivan Andreevich is offline Old Post 12-11-2008 06:49 PM
Click Here to See the Profile for Ivan Andreevich Click here to Send Ivan Andreevich a Private Message Click Here to Email Ivan Andreevich Find more posts by Ivan Andreevich Add Ivan Andreevich to your buddy list Edit/Delete Message Reply w/Quote
Ivan Andreevich
Junior Member

Registered: Nov 2003
From: Vancouver, BC

It works very well. I used the following code to populate the nsDiaglogs DropList -

${If} $1 != ".."
${AndIf} $1 != "."
SendMessage $DropList ${CB_ADDSTRING} 0 "STR:$1"
EnableWindow $DropList 1
SendMessage $DropList ${CB_SELECTSTRING} 0 "STR:$1"
${EndIf}

Quick Link | Report this post to a moderator | IP: Logged

Ivan Andreevich is offline Old Post 12-16-2008 09:55 PM
Click Here to See the Profile for Ivan Andreevich Click here to Send Ivan Andreevich a Private Message Click Here to Email Ivan Andreevich Find more posts by Ivan Andreevich Add Ivan Andreevich to your buddy list Edit/Delete Message Reply w/Quote
Animaether
Major Dude

Registered: Jun 2001
From:

awesome - glad it worked.. and yes, nsDialogs makes this sort of thing much easier (although it has a steeper learning curve than e.g. installoptions)

Quick Link | Report this post to a moderator | IP: Logged

Animaether is offline Old Post 12-16-2008 10:09 PM
Click Here to See the Profile for Animaether Click here to Send Animaether a Private Message Find more posts by Animaether Add Animaether to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 09:21 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Custom dropdown menu to show contents of a directory
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON