I was using a listbox to nav. through dirs. It shows the DOS name, ex. - C:\PROGRA~1\somef~2.txt - I want the full name. How would I go about doing that with the path AND file name?
I was using a listbox to nav. through dirs. It shows the DOS name, ex. - C:\PROGRA~1\somef~2.txt - I want the full name. How would I go about doing that with the path AND file name?
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
LOL , I just had the same problem...
You have to work with GetCurrentDirectory and SetCurrentDirectory. The params to those would be MAX_PATH + 1, and the buffer that you are reading/writing. Then, you can just get the filename from the LB_DIR listbox by:
This gets the filename. Then just lstrcat the filename onto the pathname buffer after you get the dir by calling GetCurrentDirectory.Code:i = SendMessage(hwndList, WM_GETCURSEL, 0, 0); SendMessage(hwndList, WM_GETTEXT, i, (LPARAM) szBuffer);
Garfield
1978 Silver Anniversary Corvette
That's not what I need. I need the FULL path name. Like if I hade the file - sometextfile.txt - in a listbox, it will show up something like - sometex~1.txt - but I need the full name along with path. How do I do that with GetFullPathName?
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
So, your listbox is making the filename like this?
1978 Silver Anniversary Corvette
SyntaxBubble, this shouldn't be a problem. You will be able to successfully open a file with the shortened notation. As long as the pathname is correct and the shortened filename is valid, it will be fine.
Garfield
1978 Silver Anniversary Corvette