HWND hd = GetDesktopWindow(); RECT rect; // 只获得窗口客户区的大小 ::GetClientRect(hd, &rect); int client_width = (rect.right - rect.left); int client_height = (rect.bottom - rect.top); HDC hdc = GetDC(NULL); client_width = GetDeviceCaps(hdc, HORZRES); // 宽 client_height = GetDeviceCaps(hdc, VERTRES); // 高 int DpiX = GetDeviceCaps(hdc, LOGPIXELSX ); ReleaseDC(NULL, hdc); |