unsigned int w = ::GetSystemMetrics(SM_CXSCREEN); unsigned int h = ::GetSystemMetrics(SM_CYSCREEN);
b)
RECT rect; ::GetWindowRect(::GetDesktopWindow(), &rect); unsigned int w = ::abs(rect.right - rect.left); unsigned int h = ::abs(rect.bottom - rect.top);
3. How to get DPI:
HDC hDC = ::GetDC(0); int dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX); int dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY); // dpiX == dpiY