C# 拖放在 Windows 7 上不起作用

C# Drag drop does not work on windows 7(C# 拖放在 Windows 7 上不起作用)
本文介绍了C# 拖放在 Windows 7 上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个项目使用 C# winforms 已经有一段时间了.我在 Windows 7 发布之前实现了拖放功能.像魅力一样工作.但是,当使用 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 设置为 true.订阅 DragEnter 时,它不会在 Windows 7 中调用(不确定 vista).但在 XP 上它一直有效.该程序以管理员权限运行.

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.

windows 7 和 xp 中的拖放有什么不同吗?不知道是否相关,但我使用的是 x64

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

推荐答案

源进程和目标进程需要具有兼容的安全级别/权限.例如,如果您的源是 Explorer 并且它以用户级别权限运行,但您的目标应用程序以管理员(提升)级别权限运行,您将无法拖放,因为这被视为安全问题,因为目标正在以更高级别的权限运行.

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.

这篇关于C# 拖放在 Windows 7 上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
How to store delegates in a List(如何将代表存储在列表中)
How delegates work (in the background)?(代表如何工作(在后台)?)
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)