Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`RegisterDragDrop` returns S_OK, but no calls to the method DragEnter

I'm facing this problem in Windows 7. First I define a class which implements IDropTarget. Then I use RegisterDragDrop with a handle to a control placed in a window of my application. The RegisterDragDrop returns S_OK but when I drag&drop a link from Mozilla FireFox to the control, there is no call to DragEnter nor any other function of the IDropTarget implementing object. I'm so exhausted don't know what to do. Thanks in advance

P.S: I just found out that when I run my app as administrator, this problem happens! When I just run the application normally, everything works fine! (Perhaps does it have anything to do with changing messages filter?)

like image 620
Javid Avatar asked Aug 20 '12 21:08

Javid


1 Answers

Assuming your code is correct and you've implemented your side correctly; if you're developing on Windows Vista or Windows 7, make sure you're running the application at the same privilege level as Mozilla. If you're developing in the IDE running as administrator, but run Mozilla Firefox as the logged in user, then they cannot communicate through drag-drop.

If that isn't the case, then you can try dragging files from Windows explorer to make sure your code is working correctly. It could be that Mozilla Firefox isn't using Microsoft's Ole Drag and drop subsystem correctly or at all.

like image 126
Allen Bauer Avatar answered Oct 05 '22 19:10

Allen Bauer