Is there anyway to check to see my console program is in fullscreen?
Thanks.
Printable View
Is there anyway to check to see my console program is in fullscreen?
Thanks.
For NT versions of windows, there's always been a "GetConsoleDisplayMode" function in Kernel32, but has only been documented for XP and Vista. But it works in 2K as well.
ggCode:/*-----------------------------------------------------------------------------
NT_GetConsoleDisplayMode - Get the display mode of the current console.
Parameters:
pdwMode - [out] A non-zero value indicates full screen
Returns Values:
TRUE if successful, otherwise FALSE is returned. Call GetLastError() for
extended information.
Remarks:
This only works on NT based versions of Windows.
-----------------------------------------------------------------------------*/
BOOL NT_GetConsoleDisplayMode(DWORD *pdwMode)
{
typedef BOOL (WINAPI *GCDMProc_t) (LPDWORD);
GCDMProc_t GetConsoleDisplayMode;
HMODULE hKernel32;
BOOL bFreeLib = FALSE, ret;
const char KERNEL32_NAME[] = "kernel32.dll";
hKernel32 = GetModuleHandleA(KERNEL32_NAME);
if (hKernel32 == NULL)
{
hKernel32 = LoadLibraryA(KERNEL32_NAME);
if (hKernel32 == NULL)
return FALSE;
bFreeLib = true;
}//if
GetConsoleDisplayMode =
(GCDMProc_t)GetProcAddress(hKernel32, "GetConsoleDisplayMode");
if (GetConsoleDisplayMode == NULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ret = FALSE;
}//if
else
{
ret = GetConsoleDisplayMode(pdwMode);
}//else
if (bFreeLib)
FreeLibrary(hKernel32);
return ret;
}//NT_GetConsoleDisplayMode