0

How would you set the initial position of a Console App on your Screen?

0

5 Answers 5

6

It's a console app, so it has no concept of where its window is, as it doesn't know what a window is.

Sign up to request clarification or add additional context in comments.

1 Comment

Come on, there's no need to be pedantic. The console app can find which window it is in (Assuming you know what windowing system you're running under).
5

For Windows, you could use the GetConsoleWindow function followed by SetWindowPos with the SWP_NOSIZE and SWP_NOZORDER flags set.

Comments

1

I think that you're going to be more specific. With a console app, the output goes to stdout without any real control over how the console deals with it. The console deals with displaying it and normally just prints it out.

If you want more control over the console like being able to reposition the cursor or being able to erase or redraw portions of the console, then you'll likely need to look into a library like ncurses.

Comments

1

You can't. Put simply. If you use non-standard extensions, for example, if you made your own console via WinAPI, you might be able to make such an effect. However, within terms of just cin/cout, then you can't.

Comments

0

If you're in windows, then you have to set the position of the final executable. If you click the application icon and then click "Defaults" on the resulting menu, one of the options is for position.

Unfortunately, no idea how to do that on other platforms.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.