Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Drag and drop of files in ATL

Drag and drop of files in ATL

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helpcomhardware
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    krnathan
    wrote on last edited by
    #1

    Hi, I was developing an ActiveX control that is to be embedded in IE. While trying to implement, I ran into this problem: I thought capturing the WM_DROPFILES message should be sufficient for providing drag and drop support of files (from file explorer) to the ActiveX control. While this works if the control is embedded in a thick client (say a VB form), it doesn't work when the control is embedded inside IE. IE's default handling of dropped files kicks in and it tries to open the file! I tried to look for help from the usual sources (MSDN, google etc) but most of them deal with MFC drag and drop support while I am using ATL and can't use any of those. Any help here would be greatly appreciated! Thanks, KR Nathan

    F 1 Reply Last reply
    0
    • K krnathan

      Hi, I was developing an ActiveX control that is to be embedded in IE. While trying to implement, I ran into this problem: I thought capturing the WM_DROPFILES message should be sufficient for providing drag and drop support of files (from file explorer) to the ActiveX control. While this works if the control is embedded in a thick client (say a VB form), it doesn't work when the control is embedded inside IE. IE's default handling of dropped files kicks in and it tries to open the file! I tried to look for help from the usual sources (MSDN, google etc) but most of them deal with MFC drag and drop support while I am using ATL and can't use any of those. Any help here would be greatly appreciated! Thanks, KR Nathan

      F Offline
      F Offline
      f64
      wrote on last edited by
      #2

      Hi To have drop capabilities, a control must implement IDropTarget interface and regiter itself as a drop target using the RegisterDragDrop function. Fabian

      K 1 Reply Last reply
      0
      • F f64

        Hi To have drop capabilities, a control must implement IDropTarget interface and regiter itself as a drop target using the RegisterDragDrop function. Fabian

        K Offline
        K Offline
        krnathan
        wrote on last edited by
        #3

        Thanks for this info. However, looking at the IDropTarget, it looks like much more sophisticated than what I require. When files are dragged from explorer and dropped, I just need to know the filenames of the dropped files so that I can show them in a list inside my control. WM_DROPFILES does exactly same but doesn't seem to be working when the control is placed inside IE. Thanks for your help.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups