如何获取工具栏边界矩形(VC ++) [英] How to get Toolbar Bounding rectangle (VC++)

查看:104
本文介绍了如何获取工具栏边界矩形(VC ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我在一个对话框中使用CreateWindowEx()创建了一个工具栏,其中包含(CCS_NOPARENTALIGN | CCS_NOMOVEY | CCS_TOP | ...)并将宽度和高度设置为零。现在我想将工具栏放在对话框中,但我没有工具栏边界矩形。如何获得

I created a Toolbar using CreateWindowEx() in a dialog-box with (CCS_NOPARENTALIGN | CCS_NOMOVEY | CCS_TOP | ...) and set width and height to zero. Now I want to place the toolbar in the dialog box but i do not have toolbar bounding rectangle. How to get it?

我必须为每件商品使用TB_GETITEMRECT吗?还是有其他官方方式?

Do i must use TB_GETITEMRECT for each item? or has another official way?

谢谢

推荐答案

这有用吗 - "
CreateWindowEx
功能没有用于指定工具栏大小的参数。工具栏窗口过程自动设置工具栏窗口的大小和位置。高度基于工具栏中按钮的高度。
宽度与父窗口客户区的宽度相同。 "

Does this help - "The CreateWindowEx function does not have parameters for specifying toolbar size. The toolbar window procedure automatically sets the size and position of the toolbar window. The height is based on the height of the buttons in the toolbar. The width is the same as the width of the parent window's client area. "

CCS_TOP样式"使控件将自身定位在父窗口客户区的顶部,并将宽度设置为与父窗口的宽度相同。默认情况下,工具栏具有此样式。 " b

The CCS_TOP style "Causes the control to position itself at the top of the parent window's client area and sets the width to be the same as the parent window's width. Toolbars have this style by default. "

创建工具栏(包括其按钮)后,你有它的HWND,GetWindowRect会返回什么?

After the toolbar is created (including its buttons) and you have its HWND what does GetWindowRect return?


这篇关于如何获取工具栏边界矩形(VC ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆