Cannot drag and drop to debugged-application run from a privileged-run Visual Studio 2010

可紊 提交于 2019-12-01 03:43:25

Another workaround is to run the debug binary from Windows Explorer and attach to the process from within Visual Studio via the "Tools" or "Debug" menu. I have verified that drag events are received in the debugger when using this approach.

This is by design, an aspect of UAC called UIPI (User Interface Privilege Isolation). It prevents a non-elevated process from hijacking an elevated one through Windows messages or drag and drop. It protects against shatter attacks. There is a way for the elevated process to explicitly allow messages with ChangeWindowMessageFilter. But not for drag and drop, it isn't message based.

There is no decent api-level workaround for this, it has to be done declaratively. The manifest for the program needs to use uiaccess = true, be code-signed with a certificate from an approved authority and be installed in c:\windows or c:\program files.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!