Page 1 of 1
how to display filetypes
Posted: Wed Sep 03, 2008 12:58
by Ninja
Hi Guys
how can i display all files in a folder in a combobox they will mainly be mp3 type files then dispaly the file name in a editbox
and what would be better for this a listbox or combobox
TIA
Posted: Wed Sep 03, 2008 13:17
by scriptkid
Hi,
Cegui does not provide such browse features, you'd need a local API to browse a directory for files. After that it's mainly storing all found entries in your list, like you had to do earlier when storing Image names into a ListBox
The list type mainly depends on your specs. A Combobox already has an Editbox for example, which might make things a bit more straightforward.
HTH.
Posted: Thu Sep 04, 2008 12:28
by Ninja
hi ScriptKid
thanks for your answer could i use the win32 api for this ? and if so do you know of any examples of this.
TIA
Posted: Fri Sep 05, 2008 18:47
by scriptkid
Yes, you need a combination of FindFirstFile and FindNextFile, as shown in this sample:
http://msdn.microsoft.com/en-us/library/aa365200(VS.85).aspx
It's a bit verbose, but you need the part from:
Code: Select all
// Find the first file in the directory.
hFind = FindFirstFile(szDir, &ffd);
And the the loop below it.
HTH
Posted: Sat Sep 06, 2008 11:45
by Ninja
Hi ScriptKid
Thanks for the help much appreciated