简体   繁体   English

将Win32应用程序图标添加到任务栏

[英]adding win32 app icon to task bar

I want to add some simple win32 application's icon to task bar while app is running in background. 我想在后台运行应用程序时向任务栏添加一些简单的win32应用程序图标。 During this time, i want to send some msgs to that icon so that it pops up as per my req. 在此期间,我想向该图标发送一些消息,以便根据我的要求弹出该消息。 Unfortunately i know only c\\c++ and i use visual studio8, is there a way or api to do this? 不幸的是,我只知道c \\ c ++,并且我使用visual studio8,有没有办法做到这一点? example: outlook icon or wifi icon 例如:Outlook图标或wifi图标

Sure there is an api, Shell_NotifyIcon function does that. 当然有一个api, Shell_NotifyIcon函数可以做到这一点。

You have to fill a NOTIFYICONDATA Structure and then call the above function. 您必须填充一个NOTIFYICONDATA结构 ,然后调用上面的函数。
What Shell_NotifyIcon will do depends on the flag that you'll set. Shell_NotifyIcon将执行的操作取决于您将设置的标志。

Are you after a way to just show an icon down there, or do you want pop-ups like those Outlook and the like show when something happens? 您是否只是想在此处显示一个图标,还是要在发生某些情况时显示诸如Outlook之类的弹出窗口?

To manipulate the icon itself, use Shell_NotifyIcon. 要操纵图标本身,请使用Shell_NotifyIcon。 There's a description of all of these things in this MSDN article . MSDN文章中对所有这些内容进行了描述。 IF you want to show a pop-up, then you'll need to either use the balloon pop-ups (see the article), or create your own window and manage it yourself. 如果要显示弹出窗口,则需要使用气球弹出窗口(请参阅文章),或者创建自己的窗口并自己进行管理。 It's up to you to determine which one is more appropriate for your needs. 由您决定哪个更适合您的需求。

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

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