aboutsummaryrefslogtreecommitdiff
path: root/core/sys/windows
diff options
context:
space:
mode:
authorDaniel <22991229+SentientCoffee@users.noreply.github.com>2023-01-25 14:17:20 -0500
committerDaniel <22991229+SentientCoffee@users.noreply.github.com>2023-01-25 14:17:20 -0500
commit34cb5582795a67b2d85bb4ff377322fe4bc7aeaa (patch)
tree1f27a3ebd79f0e4a076c72fc4489ccfb88ea5a45 /core/sys/windows
parent450a602230598a35bd2a39a9ce744ff2114df463 (diff)
Add win32 SetConsoleTextAttributes for setting cmd prompt colors
Diffstat (limited to 'core/sys/windows')
-rw-r--r--core/sys/windows/kernel32.odin19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/sys/windows/kernel32.odin b/core/sys/windows/kernel32.odin
index 6def41c5d..b2e820caa 100644
--- a/core/sys/windows/kernel32.odin
+++ b/core/sys/windows/kernel32.odin
@@ -3,6 +3,23 @@ package sys_windows
foreign import kernel32 "system:Kernel32.lib"
+FOREGROUND_BLUE :: WORD(0x0001)
+FOREGROUND_GREEN :: WORD(0x0002)
+FOREGROUND_RED :: WORD(0x0004)
+FOREGROUND_INTENSITY :: WORD(0x0008)
+BACKGROUND_BLUE :: WORD(0x0010)
+BACKGROUND_GREEN :: WORD(0x0020)
+BACKGROUND_RED :: WORD(0x0040)
+BACKGROUND_INTENSITY :: WORD(0x0080)
+COMMON_LVB_LEADING_BYTE :: WORD(0x0100)
+COMMON_LVB_TRAILING_BYTE :: WORD(0x0200)
+COMMON_LVB_GRID_HORIZONTAL :: WORD(0x0400)
+COMMON_LVB_GRID_LVERTICAL :: WORD(0x0800)
+COMMON_LVB_GRID_RVERTICAL :: WORD(0x1000)
+COMMON_LVB_REVERSE_VIDEO :: WORD(0x4000)
+COMMON_LVB_UNDERSCORE :: WORD(0x8000)
+COMMON_LVB_SBCSDBCS :: WORD(0x0300)
+
@(default_calling_convention="stdcall")
foreign kernel32 {
OutputDebugStringA :: proc(lpOutputString: LPCSTR) --- // The only A thing that is allowed
@@ -26,6 +43,8 @@ foreign kernel32 {
dwMode: DWORD) -> BOOL ---
SetConsoleCursorPosition :: proc(hConsoleHandle: HANDLE,
dwCursorPosition: COORD) -> BOOL ---
+ SetConsoleTextAttribute :: proc(hConsoleOutput: HANDLE,
+ wAttributes: WORD) -> BOOL ---
GetFileInformationByHandle :: proc(hFile: HANDLE, lpFileInformation: LPBY_HANDLE_FILE_INFORMATION) -> BOOL ---
SetHandleInformation :: proc(hObject: HANDLE,