开发者

How to dock an application in the Windows desktop?

开发者 https://www.devze.com 2022-12-29 19:37 出处:网络
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 re

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.

T开发者_StackOverflow中文版hanks!


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号