GetClientRect(hWnd, &rt); int DlgWidth = rt1.right - rt1.left; int DlgHeight = rt1.bottom - rt1.top ; SetWindowPos(hDlg, 0, 0, 0, DlgWidth/2, DlgHeight /2, SWP_NOZORDER | SWP_NOSIZE);