C언어,ARM

다이얼로그 창의 자식창 영역좌표 얻기

안녕1999 2020. 9. 26. 23:28
void ScreenToClient(HWND hwnd, RECT *r)//hwnd=다이얼로그 윈도우
{
	POINT *pt;
	pt = (POINT*)&(r->left);
	ScreenToClient(hwnd, pt);
	
	pt = (POINT*)&(r->right);
	ScreenToClient(hwnd, pt);
}

BOOL MyDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
    HWND h;
    RECT r;
	h = ::GetDlgItem(m_hWnd, IDC_STATIC1);
	::GetWindowRect(h, &r);
	::ScreenToClient(m_hWnd, &r);
    ...
}