16,548
社区成员




TBBUTTON button;
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iButton; (LPARAM) lParam // =
(LPARAM) (LPTBBUTTON)&button; );
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_HIDEBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) button.idCommand
(LPARAM) lParam // = (LPARAM) MAKELONG (fShow, 0)
);
TBBUTTON button;
lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) TB_GETBUTTON, // message ID (WPARAM) wParam, // = (WPARAM) (int) iButton; (LPARAM) lParam // = (LPARAM) (LPTBBUTTON)&button; );
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_HIDEBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) button.idCommand
(LPARAM) lParam // = (LPARAM) MAKELONG (fShow, 0)
);
LRESULT lResult;
TBBUTTON Button;
int i=0, newid = 70000;
int endid = newid;
do
{
lResult = ::SendMessage(
(HWND) m_wndToolBar.GetSafeHwnd(),
(UINT) TB_GETBUTTON, // message ID
(WPARAM) i , // = (WPARAM) (int) idButton
(LPARAM) (LPTBBUTTON) &Button // = (LPARAM) MAKELONG (fShow, 0)
);
if (Button.idCommand == ID_SEPARATOR)
{
::SendMessage( (HWND) m_wndToolBar.GetSafeHwnd(),
(UINT) TB_SETCMDID, // message ID
(WPARAM) (UINT)i , // = (WPARAM) (int) idButton
(LPARAM) (UINT) endid++ // = (LPARAM) MAKELONG (fShow, 0)
);
}//if
++i;
} while(lResult);
for(i=0; i<endid - newid; ++i)
{
::SendMessage( // returns LRESULT in lResult
(HWND) m_wndToolBar.GetSafeHwnd(),
(UINT) TB_HIDEBUTTON, // message ID
(WPARAM) (newid + i) , // = (WPARAM) (int) idButton
(LPARAM) MAKELONG (TRUE, 0) // = (LPARAM) MAKELONG (fShow, 0)
);
}//for