Archived

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

darkchrono4

Listbox question

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
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