Maybe you can use IDXGIAdapter
I have only 1 Monitor, so I cannot check if it works
I did this test on my OS =>
IDXGIFactory* pdxFactory;
HRESULT hr = CreateDXGIFactory(IID_PPV_ARGS(&pdxFactory));
if (SUCCEEDED(hr))
{
int nAdapter = 0;
while (1)
{
IDXGIAdapter* pdxAdapter;
hr = pdxFactory->EnumAdapters(nAdapter, &pdxAdapter);
if (FAILED(hr))
break;
else
{
WCHAR wsText[255] = L"";
swprintf(wsText, L"Adapter n°%d\n", nAdapter);
OutputDebugString(wsText);
}
DXGI_ADAPTER_DESC dxAdapterDesc;
hr = pdxAdapter->GetDesc(&dxAdapterDesc);
if (SUCCEEDED(hr))
{
WCHAR wsText[255] = L"";
swprintf(wsText, L"ID : %d - Description : %s\n", dxAdapterDesc.DeviceId, dxAdapterDesc.Description);
OutputDebugString(wsText);
}
int nOutput = 0;
while (1)
{
IDXGIOutput* pdxOutput;
if (FAILED(pdxAdapter->EnumOutputs(nOutput, &pdxOutput)))
break;
else
{
WCHAR wsText[255] = L"";
swprintf(wsText, L"\tOutput n°%d\n", nOutput);
OutputDebugString(wsText);
}
DXGI_OUTPUT_DESC dxOutputDesc;
hr = pdxOutput->GetDesc(&dxOutputDesc);
MONITORINFO mi = { sizeof(mi) };
GetMonitorInfo(dxOutputDesc.Monitor, &mi);
WCHAR wsText[255] = L"";
swprintf(wsText, L"\tDeviceName : %s - rc = {%d, %d, %d, %d}\n", dxOutputDesc.DeviceName, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom);
OutputDebugString(wsText);
pdxOutput->Release();
nOutput++;
}
pdxAdapter->Release();
nAdapter++;
}
pdxFactory->Release();
}
How does Windows Settings know? Win 7, even Win XP can do this.
Using Win32_DesktopMonitor I can get ScreenWidth and ScreenHeight, but if the driver doesn't support WDDM, these two values will not exist. And even if I get the resolution, I can't get more information like Win10 Settings.