gpt4 book ai didi

Delphi TTrayIcon BalloonFlags 自定义图标

转载 作者:行者123 更新时间:2023-12-03 18:40:58 25 4
gpt4 key购买 nike

我想更改气球中的图标。

TrayIcon1.BalloonFlags := bfWarning;

这种类型只能选择四种图标。
我想把你自己的图标。
帮我..

最佳答案

此控件是 Win32 API Shell_NotifyIcon 的包装器。 .因此,它主要向您反射(reflect)了平台提供的功能。

可用图标在相关结构的文档中进行了描述, NOTIFYICONDATA .选项包括:

  • NIIF_NONE: No icon.
  • NIIF_INFO: An information icon.
  • NIIF_WARNING: A warning icon.
  • NIIF_ERROR: An error icon.
  • NIIF_USER: Windows XP SP2 and later. Windows XP: Use the icon identified in hIcon as the notification balloon's title icon. Windows Vista and later: Use the icon identified in hBalloonIcon as the notification balloon's title icon.


这意味着底层 API 支持用户图标。但是 Delphi 包装器不让您访问该功能。

解决办法是调用 Shell_NotifyIcon直接指定 NIIF_USER并在 hBalloonIcon 中传递图标.或在 hIcon如果您的代码在 XP 上执行。

关于Delphi TTrayIcon BalloonFlags 自定义图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28496847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com