Fast answer please!!

This is a discussion on Fast answer please!! within the Windows Programming forums, part of the Platform Specific Boards category; Ok, I have a list box. How do I show all files on d:\ or e:\ drives and when one ...

  1. #1
    BubbleMan
    Guest

    Question Fast answer please!!

    Ok, I have a list box. How do I show all files on d:\ or e:\ drives and when one is selected, use PlaySound() to play the selected file? I need a short code. I am new to all the list boxes and all that.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    For WIN32 API

    Process the WM_NOTIFY in your dialog/windows callback.

    LView = (NM_LISTVIEW FAR *) lParam;
    if(LVN_ITEMCHANGED==LView->hdr.code)
    {
    if(LView->uNewState==3)//find the selected item (three is the newstate==selected)
    {
    Location=LView->iItem;
    if(LastLocation!=Location)//Location chosen is different from last one
    LastLocation=Location;
    //now play the sound

    You will need to set up columns and titles. Look through the previous posts for some code to do this.
    Don't forget to InitCommonControls().
    Use FindFirstFile and FindNextFile to get the files.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how would you answer this question?
    By smoking81 in forum Linux Programming
    Replies: 3
    Last Post: 09-08-2008, 03:53 AM
  2. Replies: 4
    Last Post: 10-29-2003, 12:18 PM
  3. getting weird answer when not using ".h"
    By CobraCC in forum C++ Programming
    Replies: 10
    Last Post: 05-07-2003, 06:21 AM
  4. Super fast bilinear interpolation
    By VirtualAce in forum Game Programming
    Replies: 2
    Last Post: 06-18-2002, 09:35 PM
  5. moving a bitmap, fast and smooth
    By werdy666 in forum Game Programming
    Replies: 1
    Last Post: 05-31-2002, 06:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21