|
Is there a function in C++ that lets you chanche or increase the size of the windoe when a program is running? (like for example in windows 95 where there is no way to scroll down if the output goes ove 20 lines?)
|
|
|
This will make your screen full screen
#include <windows.h>
#include <iostream>
BOOL NT_SetConsoleDisplayMode(HANDLE hOutputHandle, DWORD dwNewMode)
{
typedef BOOL (WINAPI *SCDMProc_t) (HANDLE, DWORD, LPDWORD);
SCDMProc_t SetConsoleDisplayMode;
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
SetConsoleDisplayMode =
(SCDMProc_t)GetProcAddress(hKernel32, "SetConsoleDisplayMode");
if (SetConsoleDisplayMode == NULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ret = FALSE;
}//if
else
{
DWORD dummy;
ret = SetConsoleDisplayMode(hOutputHandle, dwNewMode, &dummy);
}//else
if (bFreeLib)
FreeLibrary(hKernel32);
return ret;
}//NT_SetConsoleDisplayMode
int main( void )
{
NT_SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), 1 );
std::cin.get();
return 0;
} |
|
|
|
|
This will make your screen full screen
#include <windows.h>
#include <iostream>
BOOL NT_SetConsoleDisplayMode(HANDLE hOutputHandle, DWORD dwNewMode)
{
typedef BOOL (WINAPI *SCDMProc_t) (HANDLE, DWORD, LPDWORD);
SCDMProc_t SetConsoleDisplayMode;
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
SetConsoleDisplayMode =
(SCDMProc_t)GetProcAddress(hKernel32, "SetConsoleDisplayMode");
if (SetConsoleDisplayMode == NULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ret = FALSE;
}//if
else
{
DWORD dummy;
ret = SetConsoleDisplayMode(hOutputHandle, dwNewMode, &dummy);
}//else
if (bFreeLib)
FreeLibrary(hKernel32);
return ret;
}//NT_SetConsoleDisplayMode
int main( void )
{
NT_SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), 1 );
std::cin.get();
return 0;
} |
|
|
|
|
|
|
|
|
// |