Nice....I never thought about writing code that does this before.
Here's what I could do...
Standard Window API Functions can't be directly used for Console Windows.
Instead, there are a
few Console Specific API Functions that should be used.
Your code would look like this:
CODE
#include <windows.h>
#include <iostream.h>
#include <conio.h>
int main()
{
HANDLE hOut;
COORD NewSBSize;
SMALL_RECT Area = {0, 0, 0, 0};
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
NewSBSize = GetLargestConsoleWindowSize(hOut);
SetConsoleScreenBufferSize(hOut, NewSBSize);
Area.Right = NewSBSize.X - 1;
Area.Bottom = NewSBSize.Y - 1;
SetConsoleWindowInfo(hOut, TRUE, &Area);
cout<<"This is It.";
getch();
return 0;
}
Alternatively, you can simulate a double-click on the title bar which will result in the window to be maximized.