aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-03-29 10:09:49 +0200
committerGitHub <noreply@github.com>2022-03-29 10:09:49 +0200
commit085fa199eaf28b9544293a4ef1d2f8637e242af9 (patch)
tree999273ad2949054d829667a4a8c70923469289af
parent6e701ef36dc8f9c63e4d12c220f84f6f33bc0f22 (diff)
parent412c9a99d5db413580839d5f06b3de2f5ca1c435 (diff)
Merge pull request #1668 from ftphikari/master
sys/windows: add SetTimer() and KillTimer() procedures
-rw-r--r--core/sys/windows/types.odin5
-rw-r--r--core/sys/windows/user32.odin3
2 files changed, 8 insertions, 0 deletions
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 ---