Skip to content

Instantly share code, notes, and snippets.

@unknownbrackets
Created September 22, 2013 20:02
Show Gist options
  • Save unknownbrackets/6663252 to your computer and use it in GitHub Desktop.
Save unknownbrackets/6663252 to your computer and use it in GitHub Desktop.
snippet: multi monitor fun
const int screenWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN);
const int screenHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN);
const int screenX = GetSystemMetrics(SM_XVIRTUALSCREEN);
const int screenY = GetSystemMetrics(SM_YVIRTUALSCREEN);
bool visibleHorizontally = ((g_Config.iWindowX + g_Config.iWindowWidth) >= screenX) &&
((g_Config.iWindowX + g_Config.iWindowWidth) < (screenWidth + g_Config.iWindowWidth));
bool visibleVertically = ((g_Config.iWindowY + g_Config.iWindowHeight) >= screenY) &&
((g_Config.iWindowY + g_Config.iWindowHeight) < (screenHeight + g_Config.iWindowHeight));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment