Ali*_*123 6 windows taskbar desktop-application popup
我想创建一个类似于任务栏上的图标的解决方案,单击后它将作为任务栏上方的小弹出窗口打开,不会中断用户或类似于底部显示的 Microsoft People 应用程序的其他窗口如下图所示:

这个问题的标题与我的问题类似,但主题不同,提问者要求 UWP 应用程序的 AppBar,这不是我的意图。 其他问题
对于普通开发者、企业公司或微软合作伙伴来说,有没有办法做到这一点?
最近我尝试构建应用程序,在此存储库中共享https://github.com/ejabu/TrayApp
注意事项:
获得像 People App 这样的无边框窗口。
<!-- MainWindow.xaml -->
<Window
....
WindowStyle="None">
<Grid/>
</Window>
Run Code Online (Sandbox Code Playgroud)
在任务栏显示 -> False
防止它出现在任务栏上
<!-- MainWindow.xaml -->
<Window
....
ShowInTaskbar="False"
...>
<Grid/>
</Window>
Run Code Online (Sandbox Code Playgroud)
/// MainWindow.xaml.cs
private void Hide_Window()
{
this.Hide(); /// Minimize Window
}
Run Code Online (Sandbox Code Playgroud)
/// MainWindow.xaml.cs
private void AdjustWindowPosition()
{
Screen sc = Screen.FromHandle(new WindowInteropHelper(this).Handle);
if (sc.WorkingArea.Top > 0)
{
Rect desktopWorkingArea = SystemParameters.WorkArea;
Left = desktopWorkingArea.Right - Width;
Top = desktopWorkingArea.Top;
}
else if ((sc.Bounds.Height - sc.WorkingArea.Height) > 0)
{
Rect desktopWorkingArea = SystemParameters.WorkArea;
Left = desktopWorkingArea.Right - Width;
Top = desktopWorkingArea.Bottom - Height;
}
else
{
Rect desktopWorkingArea = SystemParameters.WorkArea;
Left = desktopWorkingArea.Right - Width;
Top = desktopWorkingArea.Bottom - Height;
}
}
Run Code Online (Sandbox Code Playgroud)
https://github.com/AronDavis/TwitchBot/blob/master/TwitchBotApp/Notification.xaml
https://www.youtube.com/watch?v=jdvD55ir1is
这是一个很好的例子
窗口页面没有关闭按钮。而且也不能通过注释此行来拖动它https://github.com/ejabu/AcrylicWindow/blob/343f4f5a6bc23109a97640f9ac35facb31e9ae43/AcrylicWindow/MainWindow.xaml.cs#L30
我在这里找到了示例项目
https://github.com/shenchauhan/MyPeople/tree/master/MyPeople/MyPeople
到时候我们可以看看MyPeopleCanvas。
我还发现微软有新的更新,也许我们可以在不久的将来用系统托盘图标中的文本替换图标图像。
| 归档时间: |
|
| 查看次数: |
4982 次 |
| 最近记录: |