Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8911787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:01:59+00:00 2026-06-15T04:01:59+00:00

I have created a Dialog using WTL, inheriting from CDialogImpl class, inside the main

  • 0

I have created a Dialog using WTL, inheriting from CDialogImpl class, inside the main dialog I have created another dialog and inside this second child dialog a list control. I wanted to add drag& drop functionality to the list control, I have read on the web about the WM_DROPFILES method and about the Ole Drop Target, I have chosen the later one.
I have implemented the IDropTarget interface methods in accordance to this.
I have set the accept files option to TRUE in all my dialogues, I have instantiated the IDropTarget in the child dialogue class and called the following methods in its WM_INITDIALOGUE handler:

//drag& drop 
        lpDropTarget = (LPDROPTARGET)new TDropTarget(m_hWnd);
        CoLockObjectExternal(lpDropTarget, true, true);

        // register the HWND as a drop target
        RegisterDragDrop(m_hWnd, lpDropTarget);

lpDropTarget is instantiated as follows:

LPDROPTARGET lpDropTarget;

And that’s about it. Haven’t really used Ole before so I have tried the following scenarios in search of luck:

  1. I have registered with RegisterDragDrop for the List control HWND and set it’s parent dialogue to receive the notification WM_OLEDROP WM_USER + 1 that I send. Ok the cursor for drag & drop showed but no calls to the implementation of the functions of IDataTarget.

  2. RegisterDragDrop for child dialogue & notifications for it also.

  3. RegisterDragDrop for the main Dialog & notifications for it also.

In the later cases ( 2 & 3) the cursor for drag& drop didn’t even appeared, it showed me the no-drag & drop allowed one.
Now, all the dialogues and list control have been set to accept files from the visual studio designer.
I am limited to using only ATL /WTL/WINAPI, no MFC.
What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:02:00+00:00Added an answer on June 15, 2026 at 4:02 am

    For you WM_DROPFILES is the only thing you need to handle. No need to fiddle with IDropTarget etc.

    If your application does not need to run in Admin mode, do not run it in admin mode. Disable the linker setting for the same (UAC Execution Level = asInvoker). Also, run VS in non-Admin mode, so that your application also starts are non-Admin process. This way, Explorer.exe would be able to send WM_DROPFILES message to your application.

    If your application need to run as Admin mode, you need to allow other applications to send set of few messages to your application (window). Do the following:

    ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
    ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD);
    ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);
    

    You may also want to use newer function: ChangeWindowMessageFilterEx.

    Note that, if your application must run as Admin, and you need to dynamically locate one of these function using GetProcAddress, so that your application can run on OS where this function is not available (eg. Windows XP).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following on from another question I have asked I have created a new class
In using WTL/ATL/ Windows API, I have created a window dialog with buttons and
I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
i have created a custom dialog class public class NewPost extends Dialog { //
I have written a runtime-created dialog class that doesn't use any resource files based
I am using windows forms application using C#. I have created a dialog box
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created app using jQuery Mobile and need to get a Dialog box
I have created an AlertDialog using AlertDialog.Builder, but the Dialog border takes up too
I am new to Robotium. I have created an alert dialog box using dialog

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.