Reputation: 705
I was trying to change the order of quick launch button on XP using C++, and my code looks like this:
HWND hDesktop = GetDesktopWindow();
HWND hTray = FindWindowEx( hDesktop , 0, _T("Shell_TrayWnd") , NULL );
HWND hReBar = FindWindowEx( hTray , 0, _T("ReBarWindow32") , NULL );
HWND hToolbar = FindWindowEx( hReBar , 0, _T("ToolbarWindow32") , NULL );
int Count = SendMessage(hToolbar, TB_BUTTONCOUNT, 0, 0);
SendMessage(hToolbar, TB_MOVEBUTTON, Count-1, 0);
IF there are less than 3 buttons(the defalut limits of number of the buttons that are visible in the quick launch bar) in the quick launch toolbar, the code works just fine, but when there are more than 3 buttons, the order will change for a while, and remains the same after you clicking the little arrow button at the right of the 3 showing quick launch buttons. Can anyone please tell me why this happen? and how I can fix it to make work for more than 3 buttons?
Upvotes: 0
Views: 191
Reputation: 612993
There is no officially supported API for doing this because the Quick Launch area is owned by the user and applications are expected not to change the order behind the user's back.
The user has a perfectly reasonable mechanism to re-order the buttons and you should leave it to them to do so, should they so wish.
Upvotes: 2