How to dock an application in the Windows desktop?

断了今生、忘了曾经 提交于 2019-11-27 02:23:04

问题


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). I have no idea where to start. Can it be done using XAML/WPF? Since I haven't even started coding any option is valid at this point.

Thanks!


回答1:


The most reliable way would be to register your application as an 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. http://www.codeproject.com/KB/dotnet/AppBar.aspx




回答2:


You want to create an AppBar!

Basically call SHAppBarMessage() with ABM_NEW, ABM_QUERYPOS, ABM_SETPOS and ABM_ACTIVATE, in that order.

If you want to do it from managed code, you'll have to write the interop yourself, or use this from pinvoke.net.



来源:https://stackoverflow.com/questions/2792024/how-to-dock-an-application-in-the-windows-desktop

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