V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
TangMonk
V2EX  ›  Windows

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

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

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

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

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

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

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