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

  • SEARCH
  • Home
  • 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 7995071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:18:07+00:00 2026-06-04T14:18:07+00:00

The big picuture: I am trying to inject my own own wrapper around explorer’s

  • 0

The big picuture: I am trying to inject my own own wrapper around explorer’s drag n drop. My code is injected into explorer, and I try to replace the drop target with my own.

In order to do this I am doing:

  1. Find all explorer windows (using EnumWindows and checking process association for each window).
  2. For each window I am running the following (do nothing) code:

IDropTarget* lpDT = (IDropTarget *)GetProp(hwnds[i], L”OleDropTargetInterface”); //get existing drop target

HRESULT res1 = ::RevokeDragDrop(hwnds[i]); //revoke existing drop target

HRESULT res2 = ::RegisterDragDrop(hwnds[i], lpDT); //and re-register the drop target

For now, the code does not change the drop target. I am simply un-registering and re-registering the same target.

After running it on all explorer windows I get res1 == “The application called an interface that was marshalled for a different thread.” for every window I find.

If I ignore the error (just for testing), and go ahead with replacement, the then explorer stops dragging files on the desktop (just to change the icon location). Btw, surprisingly, dragging files between 2 different folders still works.

My code is running from an explorer thread (injected into explorer).

Is there any way around this problem?

  • 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-04T14:18:08+00:00Added an answer on June 4, 2026 at 2:18 pm

    The GetProp returns a pointer to the drop target without caring about marshaling it (pure pointer). As pointed out to me in this answer, although I am getting a pointer to the drop target, it is not really marshaled to my thread.
    I can tell you that calling revokeDragDrop on the pointer (even if it did not really belong to my thread) was messing up the drop target, and then failing.

    Since I have no way of obtaining the drop target from the other thread holding it, I gave up on this and took an alternate route.

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

Sidebar

Related Questions

(big) (big) Somewhere along the way into the function animationWithFrames , my vector loses
What will be the Big-O of the following code: int f(int n) { int
I'm trying to wrap my brain around JMS and have been reading up on
In the big picture, I'm trying to implement Dijkstra's algorithm using a priority queue.
Im trying to get a text to appear as though it is too big
I'm trying to make a full screen slideshow kind of effect jsFiddle code here
I'm trying to figure out if my code is at fault or the current
Overnight hack, trying to create an environment where GAE code (using Python libs/packages) could
I have been Googling around, and cannot lock on to what I am trying
I am trying to understand the big picture of MTU. Specifically, many discussions of

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.