浏览代码

Merge pull request #4665 from GrumpyLion/add_some_missing_win_functions

Add SetWindowSubclass and RegisterHotKey functions
gingerBill 8 月之前
父节点
当前提交
bc2e57723b
共有 3 个文件被更改,包括 6 次插入0 次删除
  1. 1 0
      core/sys/windows/comctl32.odin
  2. 2 0
      core/sys/windows/types.odin
  3. 3 0
      core/sys/windows/user32.odin

+ 1 - 0
core/sys/windows/comctl32.odin

@@ -6,4 +6,5 @@ foreign import "system:Comctl32.lib"
 @(default_calling_convention="system")
 foreign Comctl32 {
 	LoadIconWithScaleDown :: proc(hinst: HINSTANCE, pszName: PCWSTR, cx: c_int, cy: c_int, phico: ^HICON) -> HRESULT ---
+	SetWindowSubclass :: proc(hwnd: HWND, pfnSubclass: SUBCLASSPROC, uIdSubclass: UINT_PTR, dwRefData: DWORD_PTR) ---
 }

+ 2 - 0
core/sys/windows/types.odin

@@ -796,6 +796,8 @@ TIMERPROC :: #type proc "system" (HWND, UINT, UINT_PTR, DWORD)
 
 WNDPROC :: #type proc "system" (HWND, UINT, WPARAM, LPARAM) -> LRESULT
 
+SUBCLASSPROC :: #type proc "system" (HWND, UINT, WPARAM, LPARAM, UINT_PTR, DWORD_PTR) -> LRESULT
+
 HOOKPROC :: #type proc "system" (code: c_int, wParam: WPARAM, lParam: LPARAM) -> LRESULT
 
 WINEVENTPROC :: #type proc "system" (

+ 3 - 0
core/sys/windows/user32.odin

@@ -2,6 +2,7 @@
 package sys_windows
 
 import "base:intrinsics"
+import "core:c"
 foreign import user32 "system:User32.lib"
 
 @(default_calling_convention="system")
@@ -32,6 +33,8 @@ foreign user32 {
 	RegisterClassExW :: proc(^WNDCLASSEXW) -> ATOM ---
 	UnregisterClassW :: proc(lpClassName: LPCWSTR, hInstance: HINSTANCE) -> BOOL ---
 
+	RegisterHotKey :: proc(hnwd: HWND, id: c.int, fsModifiers: UINT, vk: UINT) -> BOOL ---
+
 	CreateWindowExW :: proc(
 		dwExStyle: DWORD,
 		lpClassName: LPCWSTR,