Skip to main content
gamedev.net
🔒 Locked

File names

Started by DanTheRocker 5 replies 200+ views
Original Post
DanTheRocker
DanTheRocker
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 );
-Dan
Phillk6751
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.
Oluseyi
Oluseyi
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.)
DanTheRocker
DanTheRocker
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 );
-Dan
DanTheRocker
DanTheRocker
slight correction that i missed. where it says (and bmp file) i meant to say (ANY bmp file) oops.
-Dan
slepyii
slepyii
{ 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
DanTheRocker
DanTheRocker
Thank you VERY much. I was looking on the MDSN library that i got with VC++ and all the information is outdated. Thanks.
-Dan

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.