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. C / C++ / MFC
  4. WM_DROPFILES for individual control...

WM_DROPFILES for individual control...

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
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.
  • N Offline
    N Offline
    Nitron
    wrote on last edited by
    #1

    How do I get an individual control to accept WM_DROPFILES? I derived a class from CListBox and added the WM_DROPFILES handler. The control in the dialog resource has AcceptFiles set to true, and I even set:

    BOOL CSourceListBox::PreCreateWindow(CREATESTRUCT& cs)
    {
    // TODO: Add your specialized code here and/or call the base class
    cs.dwExStyle |= WS_EX_ACCEPTFILES;
    return CListBox::PreCreateWindow(cs);
    }

    The icon just shows as if drop isn't allowed. :~ Any ideas?

    ~Nitron.


    ññòòïðïðB A
    start

    L 1 Reply Last reply
    0
    • N Nitron

      How do I get an individual control to accept WM_DROPFILES? I derived a class from CListBox and added the WM_DROPFILES handler. The control in the dialog resource has AcceptFiles set to true, and I even set:

      BOOL CSourceListBox::PreCreateWindow(CREATESTRUCT& cs)
      {
      // TODO: Add your specialized code here and/or call the base class
      cs.dwExStyle |= WS_EX_ACCEPTFILES;
      return CListBox::PreCreateWindow(cs);
      }

      The icon just shows as if drop isn't allowed. :~ Any ideas?

      ~Nitron.


      ññòòïðïðB A
      start

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Nitron wrote:

      The icon just shows as if drop isn't allowed.

      You have to manage the icon yourself. You can use a CImageList. It has a bunch of members dealing with drawing a drag icon (BeginDrag,DragEnter,DragLeave,EndDrag... etc.) You also use mouse events and maybe capture the mouse during a drag operation.

      N 1 Reply Last reply
      0
      • L led mike

        Nitron wrote:

        The icon just shows as if drop isn't allowed.

        You have to manage the icon yourself. You can use a CImageList. It has a bunch of members dealing with drawing a drag icon (BeginDrag,DragEnter,DragLeave,EndDrag... etc.) You also use mouse events and maybe capture the mouse during a drag operation.

        N Offline
        N Offline
        Nitron
        wrote on last edited by
        #3

        led mike wrote:

        Nitron wrote: The icon just shows as if drop isn't allowed. You have to manage the icon yourself. You can use a CImageList. It has a bunch of members dealing with drawing a drag icon (BeginDrag,DragEnter,DragLeave,EndDrag... etc.) You also use mouse events and maybe capture the mouse during a drag operation.

        um... ok, i guess I wasn't clear on my issue... In the OnDropFiles fcn, I have a statement like: AfxMessageBox("Got Drop!"); the WM_DROPFILES message is never getting processed...

        ~Nitron.


        ññòòïðïðB A
        start

        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