如何得到一个子窗口在其父窗口上的RECT? 如何得到一个子窗口在其父窗口上的RECT?使用GetWindowRect和GetClientRect都不对啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 GetWindowRect然后ScreenToClient试一试 CRect rect;pChild->GetWindowRect(&rect);pParent->ScreenToClient(&rect);如果是客户区:CRect rect;pChild->GetClientRect(&rect);pChild->ClientToScreen(&rect);pParent->ScreenToClient(&rect); BOOL GetWindowRect( HWND hWnd, LPRECT lpRect );BOOL ScreenToClient( HWND hWnd, LPPOINT lpPoint); GetWindowRectGetParent()->ScreenToClient // 把屏幕坐标转换成当前客户区坐标void ScreenToClient(HWND hWnd, RECT *pRect){ ::ScreenToClient(hWnd, (LPPOINT)pRect); ::ScreenToClient(hWnd, ((LPPOINT)pRect) + 1);}// 获取hWnd在父窗口上的RECTRECT Rect;::GetWindowRect(hWnd, &Rect);::ScreenToClient(::GetParent(hWnd), &Rect);刚才随手写的,没测试过 创建了一个MFC DLL工程,但其中的使用gethostname时链接出错。 我想问下, GDI+是否可以抗锯齿? GDI+是不是比GDI绘图效率低很多? 谢谢 求救!关于美化界面“吃内存"的问题 socket udp 传输中的一个问题、 高分求一本书上的代码!! 该用什么控件 问大家一个C++模板的问题。 请大侠们谈一下,托管C++比mfc的优势 关于视窗滚动的问题 字符串出事了!!! 为什么我包含了stdlib.h头文件后还是不能使用min函数?请高手指点 关于无法 GetDC()
然后
ScreenToClient
试一试
pChild->GetWindowRect(&rect);
pParent->ScreenToClient(&rect);
如果是客户区:
CRect rect;
pChild->GetClientRect(&rect);
pChild->ClientToScreen(&rect);
pParent->ScreenToClient(&rect);
BOOL ScreenToClient( HWND hWnd, LPPOINT lpPoint);
GetParent()->ScreenToClient
void ScreenToClient(HWND hWnd, RECT *pRect)
{
::ScreenToClient(hWnd, (LPPOINT)pRect);
::ScreenToClient(hWnd, ((LPPOINT)pRect) + 1);
}// 获取hWnd在父窗口上的RECT
RECT Rect;
::GetWindowRect(hWnd, &Rect);
::ScreenToClient(::GetParent(hWnd), &Rect);刚才随手写的,没测试过