C++中的系统托盘图标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4964630/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 17:01:59  来源:igfitidea点击:

System Tray Icon in C++

c++winapisystem-tray

提问by Andro Miguel M. Bondoc

I got a basic window made from C++. What I need to do is whenever I click the Minimize button the window will be placed in the System Tray and whenever I double click on the Icon it will restore...

我得到了一个由 C++ 制作的基本窗口。我需要做的是每当我单击最小化按钮时,窗口将被放置在系统托盘中,每当我双击图标时,它就会恢复...

回答by tenfour

You will need to use Shell_NotifyIconto interact with the notification area (system tray).

您将需要使用Shell_NotifyIcon与通知区域(系统托盘)交互。

回答by Sid Zhang

check msdn about a struct: NOTIFYICONDATA and a function:

检查有关结构的 msdn:NOTIFYICONDATA 和函数:

BOOL Shell_NotifyIcon( DWORD dwMessage,PNOTIFYICONDATA lpdata);

BOOL Shell_NotifyIcon( DWORD dwMessage,PNOTIFYICONDATA lpdata);



and also a demohere.

以及这里的演示

Hope you can understand:)

希望你能理解:)