Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

darkchrono4

Listbox question

This topic is 5876 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using a list box created in the resource editor to list files with a certain exentsion.
  
TCHAR *FileAttribute = "*.plt";

hwndList = GetDlgItem(hDlg, IDC_PILOT_SELECT);

SendMessage(hwndList, LB_DIR, DDL_READWRITE, (LPARAM)FileAttribute);
  
These are the relevant lines of code that deal with filling the text box up. The files that it is looking for may or may not be long file names. Now if I run this on XP I get no probelm with it. But when I tried to run it on 98SE all the names are in the 8.3 format. Is there something I''m not doing right on the SendMessage or maybe that I''m using a TCHAR instead of a char?

Share this post


Link to post
Share on other sites
Advertisement
According to MSDN:

Windows 95/Windows 98/Windows Millennium Edition (Windows Me) :The list displays short filenames (the 8.3 form). You can use the SHGetFileInfo or GetFullPathName functions to get the corresponding long filename.


So you''re not doing anything wrong, it''s a limitation with Windows.

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
I did some looking after I posted this and I found that I could use GetLongFileName() for the older versions of Windows. But I''m not sure how this would work with the SendMessage().

Share this post


Link to post
Share on other sites
You''ll have to use add each long file name separately. FindFirstFile/FindNextFile/FindClose can help you list the contents of a directory using wildcards.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!