Reserve screen area in Windows 7(在 Windows 7 中保留屏幕区域)
问题描述
是否可以在 Windows 7 中为您的应用保留屏幕边缘附近的屏幕区域?它的行为类似于 Windows 任务栏(即最大化的窗口不会与其重叠).
Is it possible to reserve a screen area near an edge of the screen for your app in Windows 7? It would behave similar to the Windows taskbar (i.e. maximized windows would not overlap with it).
我正在编写一个适当支持多显示器的任务栏应用程序.主要目的是在每个屏幕上显示一个任务栏,其中仅包含该屏幕上的应用程序.没有现有的解决方案(Ulltramon、DisplayFusion) 我知道 Win 7 的工作,没有一个是开源的.
I'm writing a taskbar app with proper support for multiple monitors. The primary purpose is to show a taskbar on each screen containing only the apps on that screen. None of the existing solutions (Ulltramon, DisplayFusion) I know of work for Win 7, and none are open source.
C# 代码会很好,但也欢迎任何提示.
C# code would be nice, but any hints are appreciated as well.
推荐答案
我不确定如何直接在 C# 中执行此操作,但在本机代码中您可以使用 SPI_SETWORKAREA 调用 SystemParametersInfo.这就是任务栏、侧边栏等应用程序可以防止最大化窗口重叠的方式.
I'm unsure of how to do this directly in C#, but in native code you can call SystemParametersInfo with SPI_SETWORKAREA. This is how apps like the taskbar, sidebar, and so on can prevent maximized windows from overlapping them.
http://msdn.microsoft.com/en-us/library/ms724947.aspx 是 SystemParametersInfo 的文档.
http://msdn.microsoft.com/en-us/library/ms724947.aspx is the documentation for SystemParametersInfo.
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/9fe831e5-ccfb-4e8d-a129-68c301c83acb/显示此方法的 P/Invoke 签名.
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/9fe831e5-ccfb-4e8d-a129-68c301c83acb/ shows P/Invoke signatures for this method.
这篇关于在 Windows 7 中保留屏幕区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Windows 7 中保留屏幕区域


- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01