Shell_NotifyIcon

使用Shell_NotifyIcon 建一个标准气泡通知盒图标 虽然.net 扩展并平民化了大部分的API,但就notifyicon 来讲,系统自己的notifyicon 做的必然安全,以至于 shell32.dll 新版本(此气泡功能是win98 的ie5 就具备)的功能完全得不到体现,在优快云 我也见过不少的人都在为扩展一个更完美的notifyicon 做努力,为此笔者就在中秋前夜的一些空闲写了这个扩展控件权砖引玉,这二天就有不少朋友扔鸡蛋,于是特撰此稿来补充此控件的功能及它的具体内容以便于朋友们的二次开发,本文也定义了大部分的一些的常数和结构。 阅读详情

 

 

Shell_NotifyIcon

 

This function sends a message to the system to add, modify, or delete an icon from the taskbar status area.

Syntax
WINSHELLAPI BOOL WINAPI Shell_NotifyIcon(
  DWORD dwMessage, 
  PNOTIFYICONDATA pnid 
);
Parameters
dwMessage
[in] Specifies the message value to send. The following table shows the possible values.
ValueDescription
NIM_ADDAdds an icon to the status area.
NIM_DELETEDeletes an icon from the status area.
NIM_MODIFYModifies an icon in the status area.
pnid
[in] Pointer to a NOTIFYICONDATA structure. The content of the structure depends on the value of dwMessage.
Return Values

Nonzero indicates success. Zero indicates failure.

Code Example

The following code example demonstrates how to use Shell_NotifyIcon.

Note   To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
 
Requirements

OS Versions: Windows CE 1.0 and later.
Header: Shellapi.h.

 

 

 

 

 

 

NOTIFYICONDATA

 

This structure contains information that the system needs to process taskbar status area messages.

Syntax
typedef struct _NOTIFYICONDATA { 
  DWORD cbSize;
  HWND hWnd; 
  UINT uID; 
  UINT uFlags; 
  UINT uCallbackMessage; 
  HICON hIcon; 
  WCHAR szTip[64]; 
} NOTIFYICONDATA, *PNOTIFYICONDATA;
Members
cbSize
Size of this structure, in bytes.
hWnd
Handle to the window that receives notification messages associated with an icon in the taskbar status area.
uID
Application-defined identifier of the taskbar icon. Values from 0 to 12 are reserved and should not be used.
uFlags
Array of flags that indicate which of the other members contain valid data. This member can be a combination of the values in the following table.
ValueDescription
NIF_ICONThe hIcon member is valid.
NIF_MESSAGEThe uCallbackMessage member is valid.
NIF_TIPThe szTip member is valid.
uCallbackMessage
Application-defined message identifier. The system uses this identifier for notification messages that it sends to the window identified in hWnd. These notifications are sent when a mouse event occurs in the bounding rectangle of the icon.
hIcon
Handle to the icon to add, modify, or delete.
szTip
Null-terminated string that contains ToolTip text to display for the icon.
Requirements

OS Versions: Windows CE 1.0 and later.
Header: Shellapi.h.

 

 

 

Shell_NotifyIcon - Handling Shell_NotifyIcon failure Shell_NotifyIcon will often fail when called during Windows startup (for instance, if your application is listed in HKLM\Software\Microsoft\Windows\CurrentVersion\Run. This appears to be because the s 阅读详情

相关推荐

深入理解ShellExecuteEx与Shell_NotifyIcon的使用

本篇博客深入探讨了Windows编程中两个高级功能:ShellExecuteEx和Shell_NotifyIcon。通过具体的示例代码,介绍了如何利用ShellExecuteEx打开文件、执行程序、显示窗口等,并详细解释了其lpExecInfo结构中的各个参数的含义。同时,对Shell_NotifyIcon函数进行了讲解,包括如何在系统托盘中添加、修改或移除通知图标,并展示了相关结构体的使用方法。文章旨在为Windows开发者提供实用的编程技巧和深入理解。

weixin_42573757的博客 384

C窗口程序——Shell_NotifyIcon()函数的使用

Shell_NotifyIcon函数使用 1.Shell_NotifyIcon介绍 == Shell_NotifyIcon是Windows中用来生成系统托盘图标的API函数 == 函数原型: BOOL Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATA lpdata ); 参数说明(dwMe...

sf9090的博客 1万+

pg_listen:从NOTIFY触发shell命令

pg_listen:在Postgres事件上触发shell命令 超快速,轻巧。 使用libpq用C语言编写。 用法 pg_listen postgres://db-uri channel [/path/to/program] [args] # for example, to note when NOTIFY happened on "hello" channel # pg_listen postgres://localhost/postgres hello /bin/echo they said hi # print payload from the channel # (default action when no command is specified) # pg_listen postgres://localhost/postgres fun 请注意,pg_listen对其输出进

系统托盘Shell_NotifyIcon函数的简单运用

http://blog.youkuaiyun.com/pgshow/article/details/7526168 这里为了给同学写一个小工具,要用到系统托盘的功能,编程偶才刚入门,所以花了3个小时才调试好。趁热打铁,把学到的具体内容分享下。   要用到的函数是Shell_NotifyIcon,VC里需要包含头文件ShellApi.h。   函数就是Shell_Not

海阔天空 6575

利用API函数Shell_NotifyIcon在任务栏上放置图标。并且可以相应任务栏图标消息(5KB)

利用API函数Shell_NotifyIcon在任务栏上放置图标。并且可以相应任务栏图标消息(5KB)

Dirsearch的下载、安装和使用(全)

Dirsearch工具的下载、安装和使用,超详细超全面

weixin_68416970的博客 1万+

shell_notifyicon和NOTIFYICONDATA

shell_notifyicon和NOTIFYICONDATAShell_NotifyIcon函数,向任务栏的状态栏发送一个消息函数原型BOOL Shell_NotifIcon(DWORD dwMessage,PNOTIFYICONDATA lpdata);参数:dwMessage为输入参数,传递发送的消息,表明要执行的操作。可选的值如下:NIM_ADD向托盘区域添加一个图标。此时第二个参数lpd...

snowfoxmonitor的专栏 986

手把手教你用U盘给海信IP501H刷机:GK6323V100C芯片的4.4.2和9.0固件实战

本文详细介绍了海信IP501H电视盒子基于GK6323V100C芯片的刷机实战指南,涵盖Android 4.4.2强刷和Android 9.0免拆刷机两种方案。从工具准备、短接操作到ADB调试,提供全流程解析和常见问题解决方案,帮助用户安全高效地完成刷机操作。

lemon的博客 1458

C# WinForm调用Shell_NotifyIcon的示例代码

public class InnerClass: Form { private Shell_NotifyIconEx servicesClass = null; // 接受主CLASS 的实例句柄 internal InnerClass(Shell_NotifyIconEx _servicesClass) { servicesClass = _servicesClass; } private const int WM_LBUTTONDOWN = 0x0201; // 左键

chinaherolts2008的博客 602

逆向工程实战:解密AppleAccount的X-MMe-Nas-Qualify签名生成机制

本文通过逆向工程实战,详细解析了AppleAccount服务中X-MMe-Nas-Qualify签名的生成机制。作者利用Frida进行动态追踪定位签名源头,结合IDA Pro进行静态分析,并借助LLDB动态调试还原核心算法。文章最终分享了如何独立于苹果官方库,通过Python代码复现签名算法,为自动化测试和深度交互苹果服务的开发者提供了关键技术路径。

weixin_29323049的博客 709

别再死记硬背了!用Wireshark抓包实战,5分钟搞懂GRE、L2TP、IPsec的区别

本文通过Wireshark抓包实战,详细解析GRE、L2TP和IPsec三大隧道协议的核心差异与应用场景。从报文结构到配置示例,帮助网络工程师快速掌握这些协议的本质,提升VPN部署与故障排查能力。特别适合准备HCIP认证的工程师深化理解。

weixin_30352645的博客 439

深入理解H.NotifyIcon底层原理:Windows Shell_NotifyIcon API封装与CsWin32应用

H.NotifyIcon是一个功能强大的托盘图标(TrayIcon)库,支持WPF、WinUI、Uno和MAUI等多种框架。本文将深入剖析其底层实现原理,重点讲解如何封装Windows Shell_NotifyIcon API以及CsWin32在其中的应用,帮助开发者更好地理解和使用这个库。 ## Windows系统托盘图标核心:Shell_NotifyIcon API 系统托盘图标是Wind

gitblog_00427的博客 240

Win10/Win11共享打印机0x00000709终极修复指南:从注册表到LPD协议的全面解决方案

本文提供了Win10/Win11共享打印机0x00000709错误的终极修复指南,涵盖从注册表修改到LPD协议的全面解决方案。通过详细分析错误根源、基础修复四步法、高阶LPD协议方案及企业级深度修复策略,帮助用户彻底解决打印机共享问题,提升局域网打印效率。

weixin_33724046的博客 312

Shell_NotifyIcon 系统托盘

Shell_NotifyIcon是windows中用来生成系统托盘图标的API函数。 一、原型  BOOL Shell_NotifyIcon(  DWORD dwMessage,  PNOTIFYICONDATA lpdata  ); 二、参数及返回值说明 1.dwMessage:[输入参数] 说明要执行的动作。动作的可选值如下:      NIM_ADD 增加一个

xringm的博客 757

2023-ICCV-隐式神经网络实现低光照图像增强(NeRCo)论文解读+代码解析

NeRCo()提出了一种名为NeRCo的隐式神经表示方法,用于合作式低光图像增强。现有的低光图像增强方法存在以下三个限制:不可预测的亮度降低和噪声、度量友好版本和视觉友好版本之间的固有差距,以及有限的配对训练数据。为了解决这些限制,论文提出了NeRCo方法,它以无监督的方式稳健地恢复感知友好的结果。具体而言,NeRCo通过一个可控的拟合函数统一了现实场景中多样的退化因素,从而提高了鲁棒性。对于输出结果,论文引入了来自预训练视觉-语言模型的先验信息,采用语义导向的监督方法。

weixin_45595504的博客 3186

Android 13 wificond讲解

Android 13 wificond讲解

专业开发者的博客,一个从事Android WiFi和蓝牙的工程师 2937

系统托盘Shell_NotifyIcon 函数

1、函数格式   BOOL Shell_NotifyIcon( DWORD dwMessage,PNOTIFYICONDATA lpdata);   2、参数说明:   dwMessage为输入参数,传递发送的消息,表明要执行的操作。可选的值如下:   NIM_ADD   向托盘区域添加一个图标。此时第二个参数lpdata指向的NOTIFYICONDATA结构体中的hWnd和uID成员用

heary29的专栏 1326

人工智能_大模型095_Web版003_deepseek R1本地安装_私有化部署_支持RAG_调用HTTPAPI做自己的AI应用_安装RagFlow以及使用_---人工智能工作笔记0240

这里的一定要注意,是资源不够用了,可以点击ragflow-server左边的小绿点,查看 结果。注意去把内存改成10G把至少,我这里改成了10G,因为电脑一共就16G,再试试吧.可以看日志,就显示的是没有连接上mysql,结果我一看,mysql,根本没启动.然后下面选择general就可以了,然后点击确定,然后再去点击。手动去启动,然后再去试试,注意,内存这里给8G太小了还是.调成8G了,然后硬盘大了大了一些换成50G了,然后。点击系统模型设置可以看到,选择聊天模型就可以了,

添柴程序猿的专栏 448

Shell_NotifyIcon(NIM_MODIFY ,&nid)失败的问题

        其实问题很简单,当你指定了nid.uID之后,你就不能再次指定其它值,尽管你觉得第二次用的是IDR_ICON1啊! 不懂朋友的继续.....         刚刚在模拟“QQ消息提示”实现的过程中,使用到了Shell_NotifyIcon函数。用过QQ的朋友都知道,当QQ有新的消息传进时,位于系统托盘处的好友头像就会处于闪动状态。以程序员的角度这个闪动过程可以被拆分

握固 6674

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

Shell_NotifyIcon 修改托盘图标失败的问题

最近需要完成托盘图标闪烁的功能,但是一直没有达到效果,使用Shell_NotifyIcon 一直返回1460的错误。 后面找了很多资料发现问题;NOTIFYICONDATA结构只能在NIM_ADD里面定义一次,多次定义会导致修改托盘图标失败。 NOTIFYICONDATA m_nc;//定义在全局,只定义一次 void CFrameWnd::AddToTray() { m_nc.cbSiz

qingzai_的专栏 2791

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

关于系统响应函数OnSysCommand及托盘Shell_NotifyIcon()等

void CTestDlg::OnSysCommand(UINT nID, LPARAM lParam)这个函数响应系统控制菜单的命令.(即左上角图标处)。OnSysCommand:The framework calls this member function when the user selects a command from the Control menu, or when t

zgbsoap的专栏 8529

Shell_NotifyIcon如何强制显示tip

 例如在程序退出是,systrayicon强制显示一个提示,等待若干秒退出LRESULT CMainFrame::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled){  NOTIFYICONDATA nd; nd.cbSize = sizeof (NOTIFYICONDATA); nd.h

robin的专栏 2187

用Win32API Shell_NotifyIcon进行系统托盘图标编程

用Win32API Shell_NotifyIcon进行系统托盘图标编程示例: 附件: StealthDialog_demo.zip (2008-3-14 21:50:27, 13.25 K)该附件被下载次数 49源码: 附件: StealthDialog_src.zip (2008-3-14 21:50:27, 9.86 K)该附件被下载次数 43

johnnyrico的专栏 2572
下一篇: Using Tooltip Controls
token2012
博客等级 码龄17年 11粉丝 17原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值