C# Drag drop does not work on 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 上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C# 拖放在 Windows 7 上不起作用
基础教程推荐
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- WPF 模态进度窗口 2022-01-01
