用CreateToolbarEx()创建了一个工具栏,如何调整其大小?
我用CreateToolbarEx()创建了一个工具栏,但是当我将窗口最大化的时候,工具条并没有跟着增大,如何调整其大小,是它适合窗口的大小呢?
hwndToolbar = CreateToolbarEx (hwnd,
WS_CHILD | WS_VISIBLE ,
IDR_TOOLBAR1, 5, NULL,(UINT)hToolBarBitmap ,
tbButtonsCreate, 5, 16, 16, 16, 16, sizeof (TBBUTTON));
我做了这样一个调整的函数,没有效果,是我参数设错了,还是这样做就不对呢?
void AdjustToolbar(HWND hwndMain,HWND hwndToolbar)
{
RECT rectWindow;
RECT rectToolbar;
GetClientRect(hwndMain,&rectWindow);
GetWindowRect(hwndToolbar,&rectToolbar);
int xPos = 0;
int xLen = rectWindow.right - rectWindow.left;
int yPos = 0;
int yLen = STATUSBAR_HEIGHT;
MoveWindow(hwndToolbar,xPos,yPos,xLen,yLen,TRUE);
}