简体   繁体   English

如何在Windows中创建任务栏(系统托盘)应用程序

[英]How to make a taskbar (system tray) application in Windows

The only way I know to launch a windows application is through CreateWindow . 我知道启动Windows应用程序的唯一方法是通过CreateWindow Unfortunately, there is not a window style for a taskbar application, and I was wondering how to make a one. 不幸的是,没有任务栏应用程序的窗口样式 ,我想知道如何制作一个。 I did find this explanation in C#, but I am looking for a solution able to be compiled with VC++ 2008. Any solutions? 我确实在C#中找到了这个解释 ,但我正在寻找一个能够用VC ++ 2008编译的解决方案。任何解决方案?

The key is Shell_NotifyIcon (as other users suggested). 关键是Shell_NotifyIcon (正如其他用户建议的那样)。

In a standard scenario your application should have at least one window (at least to receive system tray notification messages). 在标准方案中,您的应用程序应至少有一个窗口(至少要接收系统托盘通知消息)。 Possibly hidden. 可能是隐藏的。 On right-click on your tray icon it's a good tone to display a sort of a popoup menu. 右键单击托盘图标,显示一种popoup菜单是一个很好的基调。

I think you may look at this . 我想你可以看看这个 This simple program demonstrates how to use the system tray in a very minimalistic way. 这个简单的程序演示了如何以非常简单的方式使用系统托盘。

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

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