When I run my program, and it opens the console window, I want it to automatically go into full screen mode.
Here is my current attempt, where it resizes the console window, but it doesn't move to fill the screen and goes off of the edge
#include
int main()
{
HWND window = GetDesktopWindow();
HWND console = GetConsoleWindow();
RECT r;
if (GetWindowRect(window, &r))
{
int width = r.right - r.left;
int height = r.bottom - r.top;
MoveWindow(console, 0, 0, width, height, TRUE);
}
}
When I run it, the console window opens to a random spot on the screen as normal, but then it grows to the size of the full screen, but the top left corner doesn't move.
When I run the program
0 comments:
Post a Comment
Thanks