-
Notifications
You must be signed in to change notification settings - Fork 0
/
consoleInterface.cpp
46 lines (36 loc) · 1.3 KB
/
consoleInterface.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "consoleInterface.h"
consoleInterface * cUI;
void consoleInterface::setupConsole()
{
cUI->ClearScreen(); $$$;
SetConsoleTitle(XOR("Erika base by Saivior1337 // 06.10.2021")); $$$;
HWND console = GetConsoleWindow(); $$$;
RECT ConsoleRect; $$$;
GetWindowRect(console, &ConsoleRect); $$$;
MoveWindow(console, ConsoleRect.left, ConsoleRect.top, 950, 400, TRUE); $$$;
}
void consoleInterface::ClearScreen()
{
CONSOLE_SCREEN_BUFFER_INFO csbi; $$$;
DWORD count; $$$;
DWORD cellCount; $$$;
COORD homeCoords = { 0, 0 }; $$$;
if (G.ConsoleHandle == INVALID_HANDLE_VALUE) return; $$$;
if (!GetConsoleScreenBufferInfo(G.ConsoleHandle, &csbi)) return; $$$;
cellCount = csbi.dwSize.X * csbi.dwSize.Y; $$$;
if (!FillConsoleOutputCharacter(G.ConsoleHandle, (TCHAR)' ', cellCount, homeCoords, &count)) return; $$$;
if (!FillConsoleOutputAttribute(G.ConsoleHandle, csbi.wAttributes, cellCount, homeCoords, &count)) return; $$$;
SetConsoleCursorPosition(G.ConsoleHandle, homeCoords); $$$;
}
void consoleInterface::TerminateThread()
{
if (GetAsyncKeyState(VK_END) & 1)
{
exit(0); $$$;
}
}
void consoleInterface::m_thread()
{
G.ConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); $$$;
setupConsole(); $$$;
}