Results 1 to 5 of 5

Thread: DragQueryFile not enough !

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2013
    Posts
    302

    DragQueryFile not enough !

    Hi,

    The DragQueryFile API doesn't return until the file is actually dropped .

    Is thare a way of knowing the path of the file that is being dragged while still dragging it ( ie: BEFORE dropping takes place) ?

    Regards.

    EDIt:
    Does the DataObject\OLEDataObject stores the file path while dragging the file ? If so I guess it could be retrieved .

    I wonder how Windows Explorer identifies the file that is being dragged.
    Last edited by JAAFAR; May 7th, 2020 at 01:01 AM.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,072

    Re: DragQueryFile not enough !

    Quote Originally Posted by JAAFAR View Post
    EDIt:
    Does the DataObject\OLEDataObject stores the file path while dragging the file ? If so I guess it could be retrieved.
    Yes

    But why is it important to know where the original file exists before it is 'dropped'? Just curious.
    Last edited by LaVolpe; May 7th, 2020 at 03:14 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2013
    Posts
    302

    Re: DragQueryFile not enough !

    Thanks LaVolpe,

    If I know the flie path before dropping the file into the target application window, I should be able to get the thumbnail of the file being dragged and display it following the mouse pointer while dragging.

  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    2,532

    Re: DragQueryFile not enough !

    Quote Originally Posted by JAAFAR View Post
    Thanks LaVolpe,

    If I know the flie path before dropping the file into the target application window, I should be able to get the thumbnail of the file being dragged and display it following the mouse pointer while dragging.
    The same thumbnail that Explorer is displaying? Just register as a drop target and use the system dragdrop helper and you get the same thumbnail. There's a demo in my signature.

    That thread and several of my other projects have code that will read the file paths out of the IDataObject if you want, and if so desired you can search for 'idataobject from dataobject" to keep using VB dragdrop instead; if you really want to go that way instead.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2013
    Posts
    302

    Re: DragQueryFile not enough !

    Thanks fafalone,

    I'll use RegisterDragDrop and then create a lightweight object for the IDropTarget Interface to catch the dragging events.
    Once the DragEnter event is triggered i can retrieve the file Path from the DataObject argument and from that I can get the bitmap associated with the file via IShellItemImageFactory::GetImage Method.

    I just hope these steps work.
    Last edited by JAAFAR; May 8th, 2020 at 02:18 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width