|
This method can hide all the icons of the tray, but just hide the icons, the tray area will leave a blank length, it is difficult to see, and it also has the feeling of "three hundred and two silver-free here":
HWND hTray = FindWindow (TEXT ("Shell_TrayWnd"), NULL);
if (hTray == NULL)
break;
hTray = FindWindowEx (hTray, NULL, TEXT ("TrayNotifyWnd"), NULL);
if (hTray == NULL)
break;
hTray = FindWindowEx (hTray, NULL, TEXT ("SysPager"), NULL);
if (hTray == NULL)
break;
hTray = FindWindowEx (hTray, NULL, TEXT ("ToolbarWindow32"), NULL);
if (hTray == NULL)
break;
iNum = SendMessage (hTray, TB_BUTTONCOUNT, NULL, NULL); // Get the number of icons on the taskbar
for (i = 0; i <iNum; i ++)
SendMessage (hTray, TB_HIDEBUTTON, i, TRUE);
hTray = NULL;
I tried refreshing the tray but it didn't work:
// refresh the tray
SendMessage (hTray, WM_PAINT, NULL, NULL);
RECT rect;
GetWindowRect (hTray,&rect);
InvalidateRect (hTray, NULL, FALSE);
Seek: After hiding all icons of the tray, the solution of the tray length is not updated, or other hiding methods? |
|