set console position

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
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.
I want the console to be apeared start from a specific coodinate if that's possible
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
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
@Lynx876
You the man, thanks allllllllllllllllllllllllllllllllllllllllllllllllllllllllllot
Topic archived. No new replies allowed.