Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Drag drop does not work on windows 7

I have had a project for quite a while using C# winforms. I implemented a drag-drop function before windows 7 was released. Worked like a charm. However, when using windows 7 it does not work. The event doesn't even get triggered.

AllowDrop is set to true. When subscribing to DragEnter it does not get called in windows 7 (not sure about vista). But on XP it works all the way. The program is run with administritave priviliges.

Is there any difference in the drag drop in windows 7 vs xp? Don't know if it's relevant, but I'm using x64

like image 783
Oskar Kjellin Avatar asked May 14 '10 11:05

Oskar Kjellin


1 Answers

The source and target processes need to have compatible security levels/privileges. For example, if your source is Explorer and it is running with user level privileges, but your target application is running with administrator (elevated) level permission, you will not be able to drag&drop as this is seen as a security issue as the target is running with a higher level of privileges.

like image 61
Tim Lloyd Avatar answered Oct 02 '22 16:10

Tim Lloyd