当前注册人数422991人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB Android   站内搜索 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

Create Icons at Runtime and Show Them in the System Tray

动态创建ICON并添加系统托盘图标源代码

2007年12月13日
C++, WinXP, VS, MFC, GDI+, Dev
本程序实现在程序运行过程中动态创建图标,并把这个图标设置成系统托盘图标,这样就可以实现像Windows中时间的托盘图标了。
相关知识

本程序是因为要动态显示RS232上的监测数据,而没有其它界面地方可以显示的情况下产生的。作者决定把这些测量的数据随时绘制到托盘图标上。

代码摘要

//create a handle for the default icon
HICON hIcon;

//load the icon from the resources
HINSTANCE hInst = 
    AfxFindResourceHandle(MAKEINTRESOURCE(IDI_ICON1),RT_GROUP_ICON);

hIcon = (HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_ICON1),
        IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
//push the icon into the system tray
源代码原文下载:
Create Icons at Runtime and Show Them in the System Tray I use a tool to observe two measured values from different thermometers via RS232. When I work with other applications on my computer during the observation time, I can't see the measured values in the dialog window, because the tool is overlaid with the window of the application. So I needed a display which is independent from the state of the desktop. I decided to write the values in icons and show these icons in the system tray repetitively.

源码图片

点击链接查看大图
从本站下载附件及源代码(1个附件,已经成功下载305次)

最值得关注的外文源代码

A More Complete DLL Injection Solution Using CreateRemoteThread
IconLib - Icons Unfolded (MultiIcon and Windows Vista supported)
graybox-A pop-up window that doesn't suck
Folder tree with drag and drop
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论57次,此处显示最近20次评论! 查看所有评论

马叉虫  2016年11月06日
不错
xiangxiang  2015年08月31日
不错的WINDOWS系统学习代码,谢谢高手!
jfgakjjk  2013年04月27日
学习一下
张清  2013年03月24日
谢谢额。
qinhao1q2w3e  2013年03月15日
太好了
风之潋滟  2013年02月25日
下下来学习一下
yndxstxy2010jrsx  2012年11月12日
这个还可以不错
carter10000  2012年10月16日
这个不错
水木淋溪  2012年09月06日
学windows编游戏,哈哈
hurrican  2012年04月08日
不错
kaoyanfor2010  2012年04月02日
学习了
wang3110  2012年01月13日
挺好
黄明  2012年01月02日
还不错,呵呵
jsurfer  2011年12月23日
还不错,呵呵
surfingpan  2011年12月20日
lgzzzz  2011年12月17日
谢谢分享
TM_linfly  2011年09月27日
很好哦!!
wph888666  2011年07月26日
谢谢
mobailwang  2011年04月08日
试一下看可不可以
ngq2011  2011年04月07日
谢谢。。。
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明