hi every one, i was trying to enter fullscreen with my console app
but for some reason it doesnt work correctly.When i launch the
Program it enters fullscreen for about 1 frame and then gets back
to windowed mode,i have tryed nearly everything now SetConsoleDisplayMode,
ALT-ENTER and even inline asm (yeah i know it wouldnt work on win32 compiler
:P )
im working with devcpp 4.9.9.2 and here is the code im using
btw is there a chance to sync the screen clearing????
Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef enum {false, true} boolean;
DWORD n;
DWORD size;
COORD coord = {0};
HANDLE h;
WORD wOldColorAttrs;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
void renderscreen(void)
{
while(1)
{
printf("test");
GetConsoleScreenBufferInfo(h, &csbiInfo);
wOldColorAttrs = csbiInfo.wAttributes;
size = csbiInfo.dwSize.X * csbiInfo.dwSize.Y;
SetConsoleTextAttribute ( h, FOREGROUND_RED | FOREGROUND_INTENSITY );
FillConsoleOutputCharacter ( h, TEXT ( ' ' ), size, coord, &n );
GetConsoleScreenBufferInfo ( h, &csbiInfo );
FillConsoleOutputAttribute ( h, csbiInfo.wAttributes, size, coord, &n );
SetConsoleCursorPosition ( h, coord );
}
SetConsoleTextAttribute ( h, wOldColorAttrs);
}
int main(int argc, char *argv[])
{
keybd_event(VK_MENU,0x38,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
h = GetStdHandle ( STD_OUTPUT_HANDLE );
renderscreen();
return 0;
}