Delphi调用IUserNotification2显示气泡提示

IUserNotification2 interface

Exposes methods that set notification information and then display that notification to the user in a balloon that appears in conjunction with the notification area of the taskbar.

Note  IUserNotification2 does not inherit from IUserNotification. IUserNotification2 differs from IUserNotification only in its Show method, which adds an additional parameter for a callback interface to communicate with the notification. Otherwise the two interfaces are identical in form and function. CLSID_UserNotification implements both versions of Show as an overload.

以上是MSDN对IUserNotification2的解释,IUserNotification2与IUserNotification接口功能差不多,除了Show方法不同外,IUserNotification2的Show方法多了IQueryContinue, IUserNotificationCallback接口,用于对气泡提示的用户操作事件进行响应控制.

主要的代码如下,TFormMain已实现了IQueryContinue, IUserNotificationCallback接口:

procedure TFormMain.Button1Click(Sender: TObject);
begin
  I.SetIconInfo(Application.Icon.Handle, 'IUserNotification2演示');
  I.SetBalloonInfo('提示标题', '这是提示内容', 3);
  I.SetBalloonRetry(1000, 5000, 3);
  I.Show(self as IQueryContinue, 1000, self as IUserNotificationCallback);
end;

 

源代码下载:http://www.ctdisk.com/file/12852384

 

程序运行示图:

气泡提示效果:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

螃蟹@横着走

感谢您的支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值