I am making a c++ project for my High School. I am using Dev c++ with graphics. What I want is when BGI window opens it should start in maximized mode instead of normal window. following is my code but it doesn't works :(
#include<iostream>
#include<conio.h>
#include<graphics.h>
#include<windows.h>
using namespace std;
void loading() {
int x=170,i,gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"");
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(170,180,"LOADING,PLEASE WAIT");
for(i=0;i<300;++i)
{
delay(30);
line(x,200,x,220);
x++;
}
getch();
}
main() {
ShowWindow( GetConsoleWindow(), SW_HIDE );
loading();
ShowWindow(FindWindow(NULL,"Windows BGI"),SW_MAXIMIZE);
}
console window gets hide according to my need but BGI window don't get Maximized. I am newbie to c++ so i don't know how to handle windows with c++. Please help with some useful code or solution.