我用MFC做个界面,想在对话框上面加个导航条样的东西,我想获得对话框横向大小,然后放张图片上去,不知道可以不?有没什么更好的方法?
解决方案 »
- 请问TeeChart控件怎么禁用鼠标滚轮?
- 窗口透明的问题
- VC中怎么样在LISTBOX中显示位图
- ★★急求一个窗口的代码★★ 把条目从一个列表选入另一个列表,类似招聘网站选择职位的那种
- 以前一直用delphi和bcb 现在要学习vc6请大家介绍几本入门的书,最基本的那种
- 各位路过大虾帮帮忙~~~~~,感激不尽
- 关于 GetCurrentPos() 返回 false 的确切原因,以及它能否精确定位鼠标位置?
- 如何使用IE的下载功能?
- 请教大虾 DBGrid 控件可不可支持打印功能 20分 谢谢帮忙!!!!!!!!!!!!
- 各路高手:点击下拉框,弹出日期选择控件,这个如何实现
- 用vc通过com写入excel很慢,有什么办法提高速度吗?
- 两个类之间变量的传递
CRect rect;
GetClientRect(rect);
就可以得到对话框的矩形大小。
The GetClientRect function retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0). BOOL GetClientRect(
HWND hWnd, // handle to window
LPRECT lpRect // address of structure for client coordinates
);typedef struct _RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;
对于对话框来说,得到的就是除了标题栏、边框以外的区域大小
如果要获得整个对话框尺寸
就用GetWindowRect
this->GetWindowRect(&rect);
CString s;
s.Format("width:%d height:%d",rect.Width(),rect.Height());
MessageBox(s);
试了下,这样可以了..