i have these code for put the window on center of screen:
Code:
HWND hwndScreen;
    RECT rectScreen;
    hwndScreen=GetDesktopWindow ();
    GetWindowRect(hwndScreen,rectScreen); 
    
    SetWindowPos(Console.WindowHandle,NULL,(rectScreen.right\2)-(consolewidth\2),(rectScreen.bottom\2)-(consoleheight\2),500,500,SWP_NOOWNERZORDER);
Console.WindowHandle is the correct handle and consolewidth and consoleheight give me the actual size of the console window.
but why i get these errors:
"Deleting intermediate files and output files for project 'test - Win32 Debug'.
--------------------Configuration: test - Win32 Debug--------------------
Compiling...
test.cpp
c:\test\test\test.cpp(44) : error C2664: 'GetWindowRect' : cannot convert parameter 2 from 'struct tagRECT' to 'struct tagRECT *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\test\test\test.cpp(46) : error C2017: illegal escape sequence
c:\test\test\test.cpp(46) : error C2143: syntax error : missing ')' before 'constant'
c:\test\test\test.cpp(46) : error C2017: illegal escape sequence
c:\test\test\test.cpp(46) : error C2017: illegal escape sequence
c:\test\test\test.cpp(46) : error C2017: illegal escape sequence
c:\test\test\test.cpp(46) : error C2059: syntax error : ')'
Error executing cl.exe.

test.exe - 7 error(s), 0 warning(s)"
???