COORD WINAPI GetLargestConsoleWindowSize(
__in HANDLE hConsoleOutput
// I know its the printf statement which is wrong as only when I wrote it I got the error
just delete line 4, 5 and 6 because it is defined in windows.h (wincon.h)
what is x.WINAPI?
>>Please advice what is wrong with the syntax
Everything. WINAPI is not a data object that can be printed.
I corrected the code and now its able to compile and I am able to make the exe file.
but I get an out put of as 00 when I execute it. I am confused as it should give me the size of the Largest Console.
I finally like the below solution as it was the best suited for what I wanted the funny thing is I found it in another thread in daniweb :)
#if (_WIN32_WINNT < 0x0500) // This switch is needed to make the program compile
#undef _WIN32_WINNT // because GetConsoleWindow needs it. See Documentation
#define _WIN32_WINNT 0x0500 // for GetConsoleWindow in MSDN.
// NOTE: This method only works if the console window has the keyboard
// focus and the user isn't hitting keys on the keyboard.
keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), 0, 0);
keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, 0), 0, 0);
keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, 0), KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), KEYEVENTF_KEYUP, 0);