From 412c9a99d5db413580839d5f06b3de2f5ca1c435 Mon Sep 17 00:00:00 2001 From: hikari Date: Tue, 29 Mar 2022 08:56:05 +0300 Subject: [PATCH] sys/windows: add SetTimer() and KillTimer() procedures --- core/sys/windows/types.odin | 5 +++++ core/sys/windows/user32.odin | 3 +++ 2 files changed, 8 insertions(+) diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin index 45c94e733..a01ac80eb 100644 --- a/core/sys/windows/types.odin +++ b/core/sys/windows/types.odin @@ -194,6 +194,8 @@ GetFileExInfoStandard: GET_FILEEX_INFO_LEVELS : 0 GetFileExMaxInfoLevel: GET_FILEEX_INFO_LEVELS : 1 +TIMERPROC :: #type proc "stdcall" (HWND, UINT, UINT_PTR, DWORD) + WNDPROC :: #type proc "stdcall" (HWND, UINT, WPARAM, LPARAM) -> LRESULT WNDCLASSA :: struct { @@ -618,6 +620,9 @@ MK_MBUTTON :: 0x0010 MK_XBUTTON1 :: 0x0020 MK_XBUTTON2 :: 0x0040 +USER_TIMER_MAXIMUM :: 0x7FFFFFFF +USER_TIMER_MINIMUM :: 0x0000000A + _IDC_APPSTARTING := rawptr(uintptr(32650)) _IDC_ARROW := rawptr(uintptr(32512)) _IDC_CROSS := rawptr(uintptr(32515)) diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin index 001434f80..772cad028 100644 --- a/core/sys/windows/user32.odin +++ b/core/sys/windows/user32.odin @@ -126,6 +126,9 @@ foreign user32 { GetKeyState :: proc(nVirtKey: c_int) -> SHORT --- GetAsyncKeyState :: proc(vKey: c_int) -> SHORT --- + SetTimer :: proc(hWnd: HWND, nIDEvent: UINT_PTR, uElapse: UINT, lpTimerFunc: TIMERPROC) -> UINT_PTR --- + KillTimer :: proc(hWnd: HWND, uIDEvent: UINT_PTR) -> BOOL --- + MessageBoxA :: proc(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT) -> c_int --- MessageBoxW :: proc(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT) -> c_int --- MessageBoxExA :: proc(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT, wLanguageId: WORD) -> c_int ---