Giter VIP home page Giter VIP logo

Comments (8)

AigioL avatar AigioL commented on July 19, 2024

今天才看到这个 issue...
WinUI 3 也许调用 WinForms 的托盘 API 比较合适,但是 WinForms 的程序集占用空间也不小
建了一个 WinUI 3 的示例项目,测试了是正常的没有闪退

但 WinUI 3/MAUI 的 Application 没有 Exit 事件,有没有类似的替代品?
因为要在程序退出时释放托盘,才能在任务栏上消失

在 Samples.WinUI3App1 这个示例项目通过使用自定义 Program 类,即 WinUIProgram 实现了 Exit 事件

from notifyicon.

WinExp avatar WinExp commented on July 19, 2024

hmmm
我再试试吧,谢谢大佬开发的库

from notifyicon.

WinExp avatar WinExp commented on July 19, 2024

还有就是大佬的托盘有没有右键菜单啊,之前用的库特别麻烦

from notifyicon.

AigioL avatar AigioL commented on July 19, 2024

https://github.com/BeyondDimension/NotifyIcon/blob/main/Samples.ClassLibrary1/NotifyIconHelper.cs#L58-L66
这段代码是添加右键菜单项的,目前只有一级菜单的支持,分割线之类的也不支持,由于 Win32 的菜单样式太丑了,通常需要自定义样式等高级功能,都是通过自己建一个窗口,在右键事件上根据光标位置显示自己的窗口

from notifyicon.

WinExp avatar WinExp commented on July 19, 2024

好的

from notifyicon.

WinExp avatar WinExp commented on July 19, 2024

话说大佬知道winui3到底怎么自定义标题栏啊,我按照官方的方法没办法用三大金刚按钮(可以不回答)

from notifyicon.

AigioL avatar AigioL commented on July 19, 2024

WinUI3 不太清楚,可能和 UWP 类似吧,不过 TitleBar 自定义通常都是将窗口改成无边框窗口,自己绘制四周一圈的内容,包括顶部的 TitleBar,与左右下的边框,WPF 中就经常使用这种方案

你可以看看 UWP 相关的方案 https://edi.wang/post/2015/10/8/windows-10-uwp-title-bar

from notifyicon.

WinExp avatar WinExp commented on July 19, 2024

好的,谢谢大佬,我close了

from notifyicon.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.