The operating system asynchronously destroyed the monitor which corresponds to this handle because the operating system's state changed. This error typically occurs because the monitor PDO associated with this handle was removed, the monitor PDO associated with this handle was stopped, or a display mode change occurred. A display mode change occurs when windows sends a WM_DISPLAYCHANGE windows message to applications.
I tried to get the brightness of the primary monitor using the following code: POINT monitorPoint = { 0, 0 }; HANDLE monitor = MonitorFromPoint(monitorPoint, MONITOR_DEFAULTTOPRIMARY); DWORD minb, maxb, currb; if (GetMonitorBrightness(monitor, &minb, &currb, &maxb) == FALSE) { std::cout << GetLastError() << std::endl; } But it fails and GetLastError() returns [...] read more