我用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);
}
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);
}
解决方案 »
- 请问如何获得单文档下的对话框大小
- listview控件选中其中的某条记录右键单击后怎样弹出一个自定义的菜单?
- MFC 类跟类之间的继承关系,高手指点。
- 请教:为什么不用memset就不行?
- 怎样得到My document的路径?
- can not download because no credit
- 请教一个edit box的问题
- 强锋科技”工作室骗人写书那件事情是怎么回事?据说“强锋”现在改名为“融智”了
- -------到底是自己扩展MFC还是用Comctl32.dll的特性?-------
- vc如何获得windows默认打印机的驱动程序名
- jiangsheng(蒋晟) 大哥请进!!
- [急!!!!]怎么向窗口发送ON_EN_UPDATE 消息??
GetDlgItem(工具条ID)->GetWindowRect(&rect);
不行啊,我用的是win32 sdk 不是mfc
还有没有其他的方法呀