Can you send a signal to Windows Explorer to make it refresh the systray icons?

前端 未结 8 798
执笔经年
执笔经年 2020-12-03 00:22

This problem has been afflicting me for quite a while and it\'s been really annoying.

Every time I login after a reboot/power cycle the explorer takes some time to s

8条回答
  •  温柔的废话
    2020-12-03 00:52

    Include following code with yours to refresh System Tray.

    public const int WM_PAINT = 0xF;
    [DllImport("USER32.DLL")]
    public static extern int SendMessage(IntPtr hwnd, int msg, int character,
                                         IntPtr lpsText);
    
    Send WM_PAINT Message to paint System Tray which will refresh it.
    SendMessage(traynotifywnd, WM_PAINT, 0, IntPtr.Zero);
    

提交回复
热议问题