-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlatform_Windows.py
96 lines (57 loc) · 1.97 KB
/
Platform_Windows.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from LAL import constant
from STL import Enum
from STL import OS
from STL import SYS
import pyuac as UAC
import win32api as API
import win32con as Con
import win32console as Console
import win32event as Event
import win32gui as GUI
import win32process as Process
ConsoleScreenBufferType = Console.PyConsoleScreenBufferType
CreateCoord = Console.PyCOORDType
CreateSmallRect = Console.PySMALL_RECTType
SetWindowPosition = GUI.SetWindowPos
SetConsoleTitle = Console.SetConsoleTitle
CreateScreenBuffer = Console.CreateConsoleScreenBuffer
MainScreenWidth = API.GetSystemMetrics(Con.SM_CXSCREEN)
MainScreenHeight = API.GetSystemMetrics(Con.SM_CYSCREEN)
class EKeyCode () :
None_ = 0x00
Arrow_Up = Con.VK_UP
Arrow_Down = Con.VK_DOWN
Arrow_Left = Con.VK_LEFT
Arrow_Right = Con.VK_RIGHT
Enter = Con.VK_RETURN
Tab = Con.VK_TAB
class CAttribute () :
FG_Red = Console.FOREGROUND_RED
FG_Green = Console.FOREGROUND_GREEN
FG_Blue = Console.FOREGROUND_BLUE
FG_Intensity = Console.FOREGROUND_INTENSITY
BG_Red = Console.BACKGROUND_RED
BG_Green = Console.BACKGROUND_GREEN
BG_Blue = Console.BACKGROUND_BLUE
BG_Intensity = Console.BACKGROUND_INTENSITY
__AllocatedConsole = False
CConsole_WhiteCell = int(CAttribute.FG_Red | CAttribute.FG_Green | CAttribute.FG_Blue | CAttribute.FG_Intensity)
CConsole_CursorMinSize = int(1)
CHandle_Top = int(Con.HWND_TOP)
CWindowFlag_NoSize = int(Con.SWP_NOSIZE)
def RequestConsole() :
if Console.GetConsoleWindow() == 0 :
print("Need to allocate console...")
Console.AllocConsole()
__AllocatedConsole = True
return Console.GetConsoleWindow()
def ReleaseConsole() :
if __AllocatedConsole :
Console.FreeConsole()
def GetKeySignal(_keyCode) :
if API.GetAsyncKeyState(_keyCode) == 0 : return False
else : return True
def Main() :
import Execution
Execution.Entrypoint()
input()