| |

VerySource

 Forgot password?
 Register
Search
View: 1075|Reply: 6

Problem: After hiding all icons of the tray, the solution of the tray length is not updated, or other hiding methods

[Copy link]

2

Threads

15

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-1-3 10:40:01
| Show all posts |Read mode
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?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-3 15:18:01
| Show all posts
Try it, TB_DELETEBUTTON
Reply

Use magic Report

2

Threads

15

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-1-3 15:57:01
| Show all posts
TB_DELETEBUTTON does not work either. And TB_HIDEBUTTON an effect.
Reply

Use magic Report

0

Threads

9

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 United States

Post time: 2020-1-4 07:12:02
| Show all posts
mark
Reply

Use magic Report

0

Threads

12

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-5 18:03:01
| Show all posts
try SendMessage (HWND_BROADCAST, WM_SETTINGCHANGE, 0, "Environment") etc.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-21 21:15:01
| Show all posts
Under XP
SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE, 0, "Environment");
No effect!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-6 21:45:01
| Show all posts
Solving, can't find the answer
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list