c# - 如何在Windows 8 Metro 界面上方绘制?

标签 c# graphics windows-8

我想绘制位于所有其他界面之上的图形,包括 Windows 8 新主屏幕。你会怎么做?在 Windows 7 及以下版本中,它就像显示一个透明的全屏窗口一样简单,但现在由于桌面与操作系统的其余部分分离,所以不再可能了。

原因是我需要显示两个独立于 Windows 鼠标光标的光标。我正在为 Wii Remote 开发多点触控模拟软件(使用传感器条指针),目前我只是设置光标位置并通过摇动 +1 和 -1 像素将其唤醒。但它会干扰触摸,所以我在使用触摸模拟时必须禁用它。它目前有效,但我想添加多点触控支持,以便您可以使用 Wii Remote 进行缩放和旋转。触摸功能已准备就绪,但您希望在按住一个触摸点并使用 Wii Remote 选择另一个触摸点时看到光标,而在按住第一个触摸点时,Windows 光标无法移动到其他任何地方,因为它坚持接触点。

我已经了解了如何通过为屏幕获取一个 Graphics 对象来直接在屏幕上绘制,但它不起作用,因为它完全不受管理,因此图形保持可见,直到其他东西刷新该区域。

那么,有什么建议吗?

涉及的项目称为 Touchmote,可在 touchmote.net 上以源代码和可安装测试版的形式获得。

最佳答案

  1. Demand the UIAccess integrity level in application manifest 通过在 requestedPrivileges 属性中指定 UIAccess=”true”。
  2. 使窗口最顶层(通过 SetWindowPos 更改位置或在 WinForms/WPF 中设置 TopMost 属性)
  3. Sign the application using a digital certificate that chains up to a trusted root in the local machine Trusted Root Certification Authorities certificate store .
  4. 直接从 not from a debugger 运行(即 a secure location in the file system )。之后您可以附加调试器。

请注意,这会使您的应用程序运行提升,您可能有 issues when you need to connect to your application from a lower integrity level

关于c# - 如何在Windows 8 Metro 界面上方绘制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14778006/

相关文章:

c# - c# 具有行锁定功能的嵌入式数据库

Android drawCircle 并不总是 360 度

java - 如何在Java中旋转图形

Java Sprite 掉落?

c# - 无论如何我可以拦截一个新电话吗?

c# - 在 dbml 文件中为 LINQ to SQL 生成关联的问题

c# - 编码 C 字符串缺少字符

windows - Windows 8 Store App 中的 XAML 对齐

multithreading - 从另一个线程WinRT中的ViewModel更新INotifyPropertyChanged-property

c++ - Windows 8(.1) 比需要多睡 1 毫秒