• ### Announcements

#### Archived

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

# 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);


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 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 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 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 on other sites
Thanks, I''ll check those out.

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627661
• Total Posts
2978496

• 10
• 12
• 22
• 13
• 33