声称与Windows任务栏类似的桌面空间的WPF应用程序 [英] WPF application that claims desktop real estate similar to windows taskbar

查看:68
本文介绍了声称与Windows任务栏类似的桌面空间的WPF应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个WPF应用程序,该应用程序旨在用作通知工具栏,用于向企业软件平台的用户发送消息.这是一个特定高度的栏,一直延伸到用户桌面的底部,一直位于Windows任务栏的正上方.

我想做的是让我的应用程序声明"或保留"它占用的空间,并且不允许任何应用程序在其后加载.例如,如果您要调整Windows任务栏的大小并将其放大,它将移动图标和快捷方式,最大化窗口将仅使用该任务栏已 未使用的桌面区域./p>

有什么想法可以解决这个问题吗?它已经被设置为桌面上的最高项目,所以这不是我的问题.现在,如果您打开另一个应用程序并将其最大化,则底部的X像素将隐藏在我的工具栏应用程序后面.

(请注意,我已经添加了Windows 7和Windows XP标记-我很希望能够在WinXP及更高版本上实现此功能,但是如果我不能在一个或多个特定版本上实现此功能,我可以想出一种解决方法)

解决方案

这些被称为 AppBars ,您可以使用SHAppBarMessage函数将窗口停靠"在显示器的一侧.然后,其他窗口最大化后,将不会遮挡停靠的窗口.

此处是链接到具有更多信息的类似问题,包括指向CodeProject页面的链接,该页面将引导您完成创建过程.

I'm building a WPF application that is designed to act as a notification toolbar for sending messages to users of an enterprise software platform. It's a bar that is a specific height, stretching all the way across the bottom of the user's desktop, sitting directly above the Windows taskbar.

What I'd like to do is to have my application "claim" or "reserve" the space it takes up and not allow any applications to load behind it. For example, if you were to resize your windows taskbar and make it larger, it will move icons and shortcuts, and maximizing windows will only use the desktop area that is not already being used by the taskbar.

Any idea how this could be pulled off? It's already set to be the topmost item on the desktop, so that's not my question. Right now if you opened another app and maximized it, then the bottom X pixels will be hidden behind my toolbar application.

(Note that I've added Windows 7 and Windows XP tags - I'd love to be able to implement this functionality on WinXP and up, but if I'm not able to do so on a particular version or versions, I can come up with a workaround)

解决方案

These are called AppBars in Windows and you can use the SHAppBarMessage function to "dock" your window to a side of a monitor. Then other windows, when maximized, will not obscure the docked window.

Here's a link to a similar question that has more information, including a link to a CodeProject page that walks you through creating one.

这篇关于声称与Windows任务栏类似的桌面空间的WPF应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆