Merge pull request #2357 from JeppeSS/sys-windows-additions

Added missing Windows functions for console manipulation
This commit is contained in:
gingerBill
2023-03-02 13:21:38 +00:00
committed by GitHub
2 changed files with 21 additions and 0 deletions

View File

@@ -370,6 +370,9 @@ foreign kernel32 {
GenerateConsoleCtrlEvent :: proc(dwCtrlEvent: DWORD, dwProcessGroupId: DWORD) -> BOOL ---
FreeConsole :: proc() -> BOOL ---
GetConsoleWindow :: proc() -> HWND ---
GetConsoleScreenBufferInfo :: proc(hConsoleOutput: HANDLE, lpConsoleScreenBufferInfo: PCONSOLE_SCREEN_BUFFER_INFO) -> BOOL ---
SetConsoleScreenBufferSize :: proc(hConsoleOutput: HANDLE, dwSize: COORD) -> BOOL ---
SetConsoleWindowInfo :: proc(hConsoleOutput: HANDLE, bAbsolute : BOOL, lpConsoleWindow: ^SMALL_RECT) -> BOOL ---
GetDiskFreeSpaceExW :: proc(
lpDirectoryName: LPCWSTR,

View File

@@ -3884,3 +3884,21 @@ COORD :: struct {
X: SHORT,
Y: SHORT,
}
SMALL_RECT :: struct {
Left: SHORT,
Top: SHORT,
Right: SHORT,
Bottom: SHORT,
}
CONSOLE_SCREEN_BUFFER_INFO :: struct {
dwSize: COORD,
dwCursorPosition: COORD,
wAttributes: WORD,
srWindow: SMALL_RECT,
dwMaximumWindowSize: COORD,
}
PCONSOLE_SCREEN_BUFFER_INFO :: ^CONSOLE_SCREEN_BUFFER_INFO