简体   繁体   English

如何将应用程序停靠在Windows桌面?

[英]How to dock an application in the Windows desktop?

I would like to develop a small notifications application for Windows in .NET that docks on the right/left side of the screen (not consuming more than 300px), should always be visible and force the rest of windows to not overlap this application (something like the old Office taskbar or Vista's Sidebar). 我想为.NET中的Windows开发一个小型通知应用程序,它停靠在屏幕的右侧/左侧(不超过300px),应始终可见并强制其余窗口不与此应用程序重叠(某些内容)比如旧的Office任务栏或Vista的补充工具栏。 I have no idea where to start. 我不知道从哪里开始。 Can it be done using XAML/WPF? 可以使用XAML / WPF完成吗? Since I haven't even started coding any option is valid at this point. 由于我甚至没有开始编码任何选项在这一点上是有效的。

Thanks! 谢谢!

The most reliable way would be to register your application as an Application Desktop Toolbar (AppBar). 最可靠的方法是将您的应用程序注册为Application Desktop Toolbar(AppBar)。

You will need to interop to do this, here is a Code Project article on doing this with C#, it should be a fair starting point. 您将需要互操作才能执行此操作,这是使用C#执行此操作的Code Project文章,它应该是一个公平的起点。 http://www.codeproject.com/KB/dotnet/AppBar.aspx http://www.codeproject.com/KB/dotnet/AppBar.aspx

You want to create an AppBar ! 你想创建一个AppBar

Basically call SHAppBarMessage() with ABM_NEW, ABM_QUERYPOS, ABM_SETPOS and ABM_ACTIVATE, in that order. 基本上按顺序使用ABM_NEW,ABM_QUERYPOS,ABM_SETPOS和ABM_ACTIVATE调用SHAppBarMessage()。

If you want to do it from managed code, you'll have to write the interop yourself, or use this from pinvoke.net. 如果您想从托管代码执行此操作,则必须自己编写interop,或者从pinvoke.net使用代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM