Draq and drop

This is a discussion on Draq and drop within the Windows Programming forums, part of the Platform Specific Boards category; hi I am working now with the Drag and drop function in Window I need my app. to detect the ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    162

    Draq and drop

    hi
    I am working now with the Drag and drop function in Window

    I need my app. to detect the dragged file because the app. only supports *.bmp files

    Is there any function that detects it? Or is this move more sophisticated and needs a struct?

    Thx for any help

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,648
    It's going to require some work using Win32 API: http://www.catch22.net/tuts/dragdrop.asp

    gg

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    If all you need is to detect the file type/name then a simpler approach would be handle the WM_DROP message for the target window. You'll need to register the window as a drop target with either the WS_EX_ACCEPTFILES extended window style at window creation or, for an already existing window, use DragAcceptFiles. Using this approach, you could either reject files that don't have the required extension or read the header information for any dropped file to ensure it's a valid bitmap, regardless of extension.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

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