How can I specify on which monitor the console window is opened?
Asked Answered
B

1

9

I've currently connected two monitors via a dock to my notebook. When I'm running my console application, the console window always pops up on the first monitor. How can I change that it's automatically opened on another monitor, e.g. on monitor 3? Maybe there is a property I need to modify?

It's very annoying to always drag the console window onto the monitor on which my IDE is opened.

Belvabelvedere answered 27/7, 2017 at 10:3 Comment(0)
E
10

Console applications (unlike GUI applications) don't create their own window; that's done by Windows, and in the case when you're running in an already created console, then you kinda inherit, e.g., cmd's window.

What you can do, though, is to find your window and move it to a different monitor.

Another option is to change the window manager settings for that application in the properties of the console window under Layout. Especially the check box »Let system position window«. To do so, first move the window where you'd like it to appear, then open the properties, go to the Layout tab, and just click »OK«.

Earthenware answered 27/7, 2017 at 10:16 Comment(1)
Be mindful of where the console properties are saved. The "Defaults" are stored in HKCU\Console. If the console is created from a shortcut, then the console properties are saved to the shortcut. Otherwise its properties are saved in a subkey of HKCU\Console. They subkey name is derived from the initial window title, which defaults to the executable's path unless the CreateProcess STARTUPINFO sets a window title. CMD's start command can set an initial title. Watch out when using an empty title string because modifying the properties will update the default properties.Phototube

© 2022 - 2024 — McMap. All rights reserved.