TangMonk
V2EX  ›  Windows

Win32 有 Api 可以删除某个 app 的托盘图标吗?

  •  
  •   TangMonk · Oct 19, 2018 · 3668 views
    This topic created in 2944 days ago, the information mentioned may be changed or developed.
    13 replies  •  2018-10-20 14:44:57 +08:00
    luojianxhlxt
    luojianxhlxt
    Oct 19, 2018 via iPhone❤️1
    1
    api 我觉得是没有的吧,自己的 app 有
    geelaw
    geelaw
    Oct 19, 2018 via iPhone❤️1
    2
    首先,那个东西叫做“通知区域”而不是“托盘”。

    其次,在主区域显示和不显示图标是用户决定的,是否有一个图标(包括可选的删除行为)是程序决定的。

    如果你不想要某个程序的图标,把它拖入通知区域的折叠区域,或者不要用那个 app,或者要求那个 app 删除自己的图标。
    crab
    crab
    Oct 19, 2018❤️1
    3
    用 SendMessage 隐藏
    TangMonk
    TangMonk
    OP
    Oct 19, 2018 via Android
    4
    @geelaw 那 tray 是什么?
    geelaw
    geelaw
    Oct 19, 2018 via iPhone
    5
    @TangMonk #27 (system) tray 也是一个错误的说法,那个东西叫 (taskbar) notification area。
    tabris17
    tabris17
    Oct 19, 2018
    6
    用 Shell_NotifyIcon 发送 NIM_DELETE 消息。不过你要先获得窗口句柄
    xupefei
    xupefei
    Oct 19, 2018
    7
    用反汇编工具 nop 掉 NIM_ADD 的那个 Shell_NotifyIconA 调用。
    geelaw
    geelaw
    Oct 19, 2018 via iPhone
    8
    @xupefei #7 按照你的思路,正确的方法是屏蔽 Shell_NotifyIconW。

    @tabris17 #6 你需要知道 uID 或者 guidItem。
    tabris17
    tabris17
    Oct 19, 2018
    9
    @geelaw 应该有办法枚举出来,这些数据应该可以从 shell 进程里获取到
    TangMonk
    TangMonk
    OP
    Oct 19, 2018
    10
    @geelaw 是 alias,不是错误的叫法

    geelaw
    geelaw
    Oct 20, 2018 via iPhone
    11
    @TangMonk #10 这是一个文档 bug。正确的说法是 mistaken as system tray among the communities,或者文档在委婉地表达这个意思。从 Windows 95 开始有这个东西以来它就叫做 notification area。

    @tabris17 #9 这显然是 unsupported way。
    TangMonk
    TangMonk
    OP
    Oct 20, 2018 via Android
    12
    @geelaw 有依据吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4079 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 03:53 · PVG 11:53 · LAX 19:53 · JFK 22:53
    ♥ Do have faith in what you're doing.