WS_EX_ACCEPTFILES and me

This is a discussion on WS_EX_ACCEPTFILES and me within the Windows Programming forums, part of the Platform Specific Boards category; I am trying to figure out how to allow a program to just populate a list of usable files for ...

  1. #1
    Registered User AtomRiot's Avatar
    Join Date
    Jan 2003
    Posts
    120

    WS_EX_ACCEPTFILES and me

    I am trying to figure out how to allow a program to just populate a list of usable files for the program by having the user drag them and drop them on the area but i cant figure out what to do next.
    i tried using the WS_EX_ACCEPTFILES in the windows styles but i dont know what to do next
    what message does that send when it gets a file? i have played with WM_DROPFILES but i guess i dont totally understand that and it must not be used with ws_ex_accept files unless i am using it wrong or i am not initializing something.
    does anyone know what kinda of messages is sent when the WS_EX_ACCEPTFILES message is used? or how to handle it?
    All Your Base Are Still Belong to Someone!!!
    And you Remember that!!!

  2. #2
    Registered User AtomRiot's Avatar
    Join Date
    Jan 2003
    Posts
    120
    dang i always forget this part, i am using win32 api (NO MFC) for this and trying to drop them into a static box in the window
    All Your Base Are Still Belong to Someone!!!
    And you Remember that!!!

  3. #3
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,262
    I've never implemented drag-and-drop myself, but as far as I can see, when you receive the WM_DROPFILES message, the wParam is a handle to the dropped files.

    First, set an integer to DragQueryFiles(hDrop, 0xFFFFFFFF, NULL, 0) to find out how many files have been dropped, then do a loop with DragQueryFiles(hDrop, i, szFilename, lstrlen(szFilename)) to get each file name in turn.

    Finally, call DragFinish(hDrop) to free the system memory used to transfer the information.

Popular pages Recent additions subscribe to a feed

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