15,979
社区成员
发帖
与我相关
我的任务
分享
HWND hWnd = ......;
//相对于屏幕左上角坐标
RECT rtWindow = {0};
::GetWindowRect(hWnd, &rtWindow);
//相对于其父窗口左上角坐标
POINT pt = {rtWindow.left, rtWindow.top};
::ScreenToClient(hWndParrent, &pt);
RECT rtWindowWithParrent = {pt.x, pt.y, pt.x+(rtWindow.right-rtWindow.left), pt.y+(rtWindow.bottom-rtWindow.top)};
//客户区坐标,即相对于自身左上角坐标,left==top==0
RECT rtClient = {0};
::GetClientRect(hWnd,&rtClient);
发消息就使用::PostMessage或者::SendMessage