How to know if monitor is connected?
-
Is it possible to programmatically find out if the monitor is connected to the computer? I would be very grateful if someone could provide that answer!
Hello I was using
EnumDisplayMonitors
to find all monitors on the system. Try it.EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, NULL); .. BOOL CALLBACK MonitorEnumProc( HMONITOR hMonitor, // handle to display monitor HDC hdcMonitor, // handle to monitor DC LPRECT lprcMonitor, // monitor intersection rectangle LPARAM dwData // data ) { MONITORINFO mi; mi.cbSize = sizeof(mi); if (GetMonitorInfo(hMonitor, &mi)) { ... } return TRUE; }
-
Hello I was using
EnumDisplayMonitors
to find all monitors on the system. Try it.EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, NULL); .. BOOL CALLBACK MonitorEnumProc( HMONITOR hMonitor, // handle to display monitor HDC hdcMonitor, // handle to monitor DC LPRECT lprcMonitor, // monitor intersection rectangle LPARAM dwData // data ) { MONITORINFO mi; mi.cbSize = sizeof(mi); if (GetMonitorInfo(hMonitor, &mi)) { ... } return TRUE; }
-
-