[C] Implementing Drag & Drop with Windows API

Discussion in 'Mixed Languages' started by Pr3acher, Feb 3, 2013.

  1. Pr3acher

    Pr3acher MDL Member

    Aug 24, 2012
    142
    48
    10
    Hi, i'm working on a little project and i would like to implement the Drag and Drop feature. It's WinAPI C based. I searched around on the Net, but didn't find anything concerning WinAPI, just found for C#, Vb...

    Thanks :)
     
  2. Calistoga

    Calistoga MDL Senior Member

    Jul 25, 2009
    420
    198
    10
    Hi. I'm assuming that you mean dragging and dropping files from Windows Explorer.

    You should handle the WM_DROPFILES message.

    Call DragAcceptFiles() to inform Windows that you are able to process WM_DROPFILES. The wParam will be a (HDROP) handle to an internal structure describing the dropped files. This handle can be used with DragFinish(), DragQueryFile(), and DragQueryPoint() to retrieve information about the dropped files.

    Should get you started :)
     
  3. Pr3acher

    Pr3acher MDL Member

    Aug 24, 2012
    142
    48
    10
    #3 Pr3acher, Feb 8, 2013
    Last edited: Mar 7, 2013
    (OP)
    Ok thank you very much, i think it will be enough for me to do what i want, Thanks ! :)

    Edit: Ok i'm done thanks, but just annother thing. The drag & drop is enabled on the whole window, i just want to limit this to an edit control, any idea how i can do this ? thx all