Listbox question

Started by
3 comments, last by darkchrono4 21 years, 8 months ago
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?
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.
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().
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.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Thanks, I''ll check those out.

This topic is closed to new replies.

Advertisement