Arystar 0 Newbie Poster

hi im stuck
i'm making a program and i made it get maximized on open with this nice code

void Openmax()
{ 
  HWND hWnd = GetConsoleWindow();
  ShowWindow(hWnd,SW_SHOWMAXIMIZED);     
}

but now it also needs to open in the center of the screen.

i tried the SetWindowPosition() and SetConsolePos()
but i couldn't get it working. maybe i used them wrong

can someone pls assist me on this or give me C++ code to open the console app in centerscreen.

thx Arystar

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.