Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AllocConsole();
- AttachConsole(GetCurrentProcessId());
- freopen("CON", "w", stdout);
- freopen("CONIN$", "r", stdin);
- // Screens
- // If you have multiple screens, this will automatically move the console to the 2nd
- if (GetSystemMetrics(SM_CMONITORS) > 1)
- {
- // Console Window
- HWND hConsole = GetConsoleWindow();
- RECT rect;
- GetWindowRect(hConsole, &rect);
- // Desktop
- HWND hDesktop = GetDesktopWindow();
- RECT rDesktopRect;
- GetWindowRect(hDesktop, &rDesktopRect);
- // Update Position
- SetWindowPos(hConsole, nullptr, rDesktopRect.right + 100, 50, rect.right - rect.left, rect.bottom - rect.top, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment