Created
September 27, 2018 13:01
-
-
Save berlysia/bd50b4e1796f7da05a000a13d6a2862a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <Windows.h> | |
BOOL CALLBACK monitor_enum_proc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM cbData) { | |
MONITORINFOEX mi; | |
mi.cbSize = sizeof(mi); | |
GetMonitorInfo(hMonitor, &mi); | |
std::wstring szDevice(mi.szDevice); | |
std::cout << mi.rcMonitor.left << ", " << mi.rcMonitor.top << ": "; | |
std::wcout << szDevice << std::endl; | |
return true; | |
} | |
int main() { | |
EnumDisplayMonitors(NULL, NULL, monitor_enum_proc, NULL); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment