It works here, but it doesn't go to the far top-left corner (0,0). Instead its like 100, 100 for some reason. I often have to move the window so it fits the full screen. Any advice is appreciated. Thanks.
Code:
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
COORD NewSBSize = GetLargestConsoleWindowSize(hOut);
SMALL_RECT DisplayArea = {0, 0, 0, 0};
SetConsoleScreenBufferSize(hOut, NewSBSize);
DisplayArea.Right = NewSBSize.X - 1;
DisplayArea.Bottom = NewSBSize.Y - 1;
SetConsoleWindowInfo(hOut, TRUE, &DisplayArea);
return 0;
}
Another way is to change the ALT+ENTER it does on its own here to max the window button. Any idea?
Code:
int main()
{
HWND hWnd;
SetConsoleTitle("test");
hWnd = FindWindow(NULL,"test");
SendMessage(hWnd,WM_SYSKEYDOWN,
VK_RETURN,0xFF000000);
cout << "Hello World\n";
return 0;