set console position

Mar 14, 2013 at 1:33pm
closed account (28poGNh0)
Hey everyone ,I have another question on console wnd

I am looking now for a function or manner to set the position of the console
for exemple I want the console to apear in the middle of the screen
also is there a "console controle" book,

thanks a lot guys
Mar 14, 2013 at 2:01pm
I would imagine this would be very OS dependent, so you look towards your OS documentation, which I assume to be Windows. So go look at the WinAPI.

As for books, probably not. The console/terminal isn't meant for this.
Mar 14, 2013 at 2:20pm
closed account (28poGNh0)
I want the console to be apeared start from a specific coodinate if that's possible
Mar 14, 2013 at 2:30pm
closed account (3qX21hU5)
If you are on window's get the console's handle with GetConsoleWindow(); http://msdn.microsoft.com/en-us/library/windows/desktop/ms683175(v=vs.85).aspx

once you have that use MoveWindow() http://msdn.microsoft.com/en-us/library/windows/desktop/ms633534(v=vs.85).aspx
Last edited on Mar 14, 2013 at 2:33pm
Mar 14, 2013 at 4:02pm
1
2
3
4
5
6
7
8
9
10
#include <windows.h>

int main()
{
	HWND consoleWindow = GetConsoleWindow();

	SetWindowPos( consoleWindow, 0, 500, 500, 0, 0, SWP_NOSIZE | SWP_NOZORDER );	

	return 0;
}


This is how I used the below function:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx
Mar 16, 2013 at 7:10am
closed account (28poGNh0)
@Lynx876
You the man, thanks allllllllllllllllllllllllllllllllllllllllllllllllllllllllllot
Topic archived. No new replies allowed.