TB_BUTTONCOUNT message can't get system tray icon's count any more after Win11 22H2 (10.0.22621).
https://learn.microsoft.com/en-us/windows/win32/controls/tb-buttoncount
The following code can get system tray icon's information in the Win10 system, and the following code is invalid after upgrading to 22621, that always get 0.
Is there a new method or API that can get system tray icon's information after Win11 22621?
HWND m_HWND = ::FindWindow(_T("Shell_TrayWnd"), NULL);
if (m_HWND != NULL) m_HWND = ::FindWindowEx(m_HWND, NULL, _T("TrayNotifyWnd"), NULL);
if (m_HWND != NULL) m_HWND = ::FindWindowEx(m_HWND, NULL, _T("SysPager"), NULL);
if (m_HWND != NULL) m_HWND = ::FindWindowEx(m_HWND, NULL, _T("ToolbarWindow32"), NULL); LRESULT nTrayCount = ::SendMessageW(m_HWND, TB_BUTTONCOUNT, 0, 0);