Code:
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
HWND conwin = GetConsoleWindow();
RECT conrect;
if (!conwin || !GetWindowRect(conwin, &conrect))
{
cerr << "Error" << endl;
return 1;
}//if
cout << "(" << conrect.left << "," << conrect.top << ")-("
<< conrect.right << "," << conrect.bottom << ")" << endl;
int width = conrect.right - conrect.left;
int height = conrect.bottom - conrect.top;
cout << "W=" << width << endl;
cout << "H=" << height << endl;
cout << "Moving to 0,0...." << endl;
MoveWindow(conwin, 0, 0, width, height, TRUE);
return 0;
}//main
Tutorial for other console manipulations in Win32: Win32 Console Applications 1
gg