Archived

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

DanTheRocker

File names

Recommended Posts

I have a list box in a dialog that runs before my game runs and the list box displays all the bitmaps in the directory. It works, I''m happy, but there is one slight problem. When a file name is more than about 8 characters, it converts something like this "T_Mud_001.bmp" into "t_mud_~5.bmp". Is there something that i can change to make it display the full file name? Here is the code: //The sttributes of the files to find UINT uAttrs; //The thing that lets me specify which type of file LPCTSTR lpszFileSpec; //Include archived files uAttrs = DDL_ARCHIVE; //All files of type .bmp lpszFileSpec = "*.bmp*"; //This automatically searches and loads all files matching the //requirements SendDlgItemMessage( hWnd, ID_TILE_AVAILABLE, LB_DIR, //Adds filenames to the list box (WPARAM) (UINT) uAttrs, (LPARAM) (LPCTSTR) lpszFileSpec );

Share this post


Link to post
Share on other sites
if you are using VB then i don''t know but if you are using C++ then you are most likely using a dos compiler....with a dos compiler the filename is shortened and if it is a windows compiler then you''re probably looking at the file tree through dos.

Share this post


Link to post
Share on other sites
quote:
Original post by Phillk6751
if you are using VB then i don''t know but if you are using C++ then you are most likely using a dos compiler....with a dos compiler the filename is shortened and if it is a windows compiler then you''re probably looking at the file tree through dos.


He has a dialog box, he''s using hungarian notation and Windows-defined type, and yet you think he''s using a DOS compiler? And the variables are obviously C++ (VB uses different variable types).

Don''t post just to post; if you don''t know, move on.

(I shall now take my own advice.)

Share this post


Link to post
Share on other sites
I''m using windows in my program. The WinAPI function SendDlgItemMessage below automaticaly looks for all the files that meet the criteria specified by uAttrs.(and bmp file). It automaticaly fills the dislog with all the file names.
I hope that made it a little easier to understand.

SendDlgItemMessage( hWnd,
ID_TILE_AVAILABLE,LB_DIR,
//Addsfilenames to the list box
(WPARAM) (UINT) uAttrs,
(LPARAM) (LPCTSTR) lpszFileSpec );

Share this post


Link to post
Share on other sites
{ cut from Platform SDK }
Windows NT/2000/XP: The list displays long filenames, if any.

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

Information on this command can be found in the Platform SDK available on microsofts web site. I would recomend downloading it if you plan on doing any programming using windows. I have provided the link directly to the documentation on the command you are using to fill the list box.

Click me to see the docs

Edited by - slepyii on October 16, 2001 2:20:58 PM

Edited by - slepyii on October 16, 2001 2:21:56 PM

Share this post


Link to post
Share on other sites