Thread: Viewing full filename in ListBox?

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Viewing full filename in ListBox?

    I have something in a ListBox withe a file thing in it where you can nav. through your files. How do I show the full name instead of just DOS 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

  2. #2
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    How are you putting the file names in the listbox? Either sending a LB_DIR message or using the DlgDirList() function will result in the full name being displayed.
    zen

  3. #3
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Smile This is what...

    I am using LB_DIR. When it's in the LB it shows up as something like this:


    (example)

    progr~1.exe

    How do I show:

    "program.exe"?
    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

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    not sure what header this is in...try stdlib.h...here's the list of headers I have at the top of the program I have this in

    #include <windows.h>
    #include <stdio.h>
    #include "resource.h"
    #include "resrc1.h"
    #include <mmsystem.h>
    #include <process.h>
    #include <stdio.h>
    #include <conio.h>
    #include <io.h>
    #include <string.h>
    #include <stdlib.h>

    Code:
    char pathname[255]={0};
    struct _finddata_t fileinfo;
    long findhandle;
    
    				GetDlgItemText(hwnd, IDC_FOLDER, pathname, 255);
    				strcat(pathname,"*.mp3");
    
    				findhandle = _findfirst(pathname,&fileinfo);
    
    				if (findhandle==-1)
    				{
    					MessageBox(NULL, "Directory Not Found", "Error", MB_OK);
    					return FALSE;
    				}
    				SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)fileinfo.name);
    				while(_findnext(findhandle,&fileinfo)==0)
    				{
    					SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)fileinfo.name);
    				}
    that help you any?

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    There is no call to

    _findclose()

    to terminate the function call
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 04-11-2009, 01:49 AM
  2. Generic Resource_Manager WIP with lots TODO
    By Shamino in forum C++ Programming
    Replies: 19
    Last Post: 02-01-2006, 01:55 AM
  3. How to cast a ListBox item to an int for a switch statment?
    By Swaine777 in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2004, 08:52 PM
  4. hashing help
    By alokin in forum C Programming
    Replies: 17
    Last Post: 10-28-2002, 06:33 PM
  5. Getting FULL filename from listbox
    By Garfield in forum Windows Programming
    Replies: 8
    Last Post: 01-27-2002, 08:28 AM