![]() |
| | #1 |
| the Corvetter Join Date: Sep 2001
Posts: 1,584
| Getting FULL filename from listbox Garfield
__________________ 1978 Silver Anniversary Corvette |
| Garfield is offline | |
| | #2 |
| Registered User Join Date: Aug 2001
Posts: 125
| hello; The problem is that your using LB_DIR, because it sets the files with the old dos style. If i were you i would change the way you set your list box. I would either use the FindFirstFile, FindNextFile functions, or i would get whatever directory the user is setting the files from, and then append the file name on the end of that, then i would output the whole file name and location to the list control. Actually the way i would do it is i would just store the current directory location in a buffer and then call that when the user dbl clicks, so they dont see the full directory name just the file name, but when you call on gettext it will get the full directory and file name, so you can shell..() it or whatever you want. hope this makes some scence.
__________________ arrh, i got nothing good to say. http://www.praxis1.vic.edu.au/home/dcola/ |
| The15th is offline | |
| | #3 |
| the Corvetter Join Date: Sep 2001
Posts: 1,584
| Yes, I was thinking about appending the filename (from the listbox) onto the full pathname, but how would I get the directory of the view of the listbox at the point in which the user dblclicks? Thanks... Garfield
__________________ 1978 Silver Anniversary Corvette |
| Garfield is offline | |
| | #4 |
| Registered User Join Date: Aug 2001
Posts: 125
| I need a little bit more background information before i can help you any further. Are all the files in the same directory? Are you setting the files with a OpenFile dlg box? Is the user able to set any file on the directory from any location? After just reading your first post, it sounds like your just setting one directory, which in that case you could just store that location when it is first set, and call upon it on the dblclk message. Anyway just let me know how your setting your location.
__________________ arrh, i got nothing good to say. http://www.praxis1.vic.edu.au/home/dcola/ |
| The15th is offline | |
| | #5 |
| the Corvetter Join Date: Sep 2001
Posts: 1,584
| Well, I want to use all of the directories possible. The list box should display the files and the "[..]" to go up and down through the directories. And then at the right directory, the user clicks the file, but I also want to get the full filename including the path. How can I do this? Garfield
__________________ 1978 Silver Anniversary Corvette |
| Garfield is offline | |
| | #6 |
| Registered User Join Date: Aug 2001
Posts: 125
| quite easily; If you have already enabled the user to navigate through their directories that means your using GetCurrentDirectory() and SetCurrentDirectory(). When you store this information you can just call back on it later. Have you already setup your proc to navigate through the directories? All you need to do is call GetCurrentDirectory (MAX_PATH + 1, DirectoryBuf) ; and hold that information untill the user moves to a new location, then any file name inside the list control will be in the location held in DirectoryBuf. I hope im helping you, if you would like some code just ask me and ill write some for you, but try and write your own, its more fun that way!
__________________ arrh, i got nothing good to say. http://www.praxis1.vic.edu.au/home/dcola/ |
| The15th is offline | |
| | #7 |
| the Corvetter Join Date: Sep 2001
Posts: 1,584
| Okay, I know where to go from here. Thanks!
__________________ 1978 Silver Anniversary Corvette |
| Garfield is offline | |
| | #8 | |
| Refugee Join Date: Aug 2001
Posts: 2,052
| Quote:
__________________ Please direct all complaints regarding this post to the nearest brick wall Have a nice day. | |
| face_master is offline | |
| | #9 | |
| the Corvetter Join Date: Sep 2001
Posts: 1,584
| Quote:
SendMessage(hwndList, LB_DIR, DIRATTR, TEXT("*.*")); to fill the list box with the filename strings. DIRATTR is a whole list of constants for displaying what type of files, directories. Simply as that. And then you can program to move through the directories with testing the string of the listbox. Garfield
__________________ 1978 Silver Anniversary Corvette | |
| Garfield is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Im getting an error and i cant figure out why. please help. | ominub | C Programming | 8 | 04-11-2009 01:49 AM |
| Pass Filename to another function | awesmesk8er | C Programming | 9 | 10-24-2008 01:43 PM |
| How to cast a ListBox item to an int for a switch statment? | Swaine777 | C++ Programming | 8 | 09-26-2004 08:52 PM |
| hashing help | alokin | C Programming | 17 | 10-28-2002 06:33 PM |
| Viewing full filename in ListBox? | SyntaxBubble | Windows Programming | 4 | 12-09-2001 10:21 PM |