mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Remove A calls in favour of W calls
This commit is contained in:
@@ -5,43 +5,20 @@ foreign import user32 "system:User32.lib"
|
||||
|
||||
@(default_calling_convention="stdcall")
|
||||
foreign user32 {
|
||||
GetClassInfoA :: proc(hInstance: HINSTANCE, lpClassNAme: LPCSTR, lpWndClass: ^WNDCLASSA) -> BOOL ---
|
||||
GetClassInfoW :: proc(hInstance: HINSTANCE, lpClassNAme: LPCWSTR, lpWndClass: ^WNDCLASSW) -> BOOL ---
|
||||
GetClassInfoExA :: proc(hInsatnce: HINSTANCE, lpszClass: LPCSTR, lpwcx: ^WNDCLASSEXA) -> BOOL ---
|
||||
GetClassInfoExW :: proc(hInsatnce: HINSTANCE, lpszClass: LPCWSTR, lpwcx: ^WNDCLASSEXW) -> BOOL ---
|
||||
|
||||
GetClassLongA :: proc(hWnd: HWND, nIndex: c_int) -> DWORD ---
|
||||
GetClassLongW :: proc(hWnd: HWND, nIndex: c_int) -> DWORD ---
|
||||
SetClassLongA :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG) -> DWORD ---
|
||||
SetClassLongW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG) -> DWORD ---
|
||||
|
||||
GetWindowLongA :: proc(hWnd: HWND, nIndex: c_int) -> LONG ---
|
||||
GetWindowLongW :: proc(hWnd: HWND, nIndex: c_int) -> LONG ---
|
||||
SetWindowLongA :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG) -> LONG ---
|
||||
SetWindowLongW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG) -> LONG ---
|
||||
|
||||
GetClassNameA :: proc(hWnd: HWND, lpClassName: LPSTR, nMaxCount: c_int) -> c_int ---
|
||||
GetClassNameW :: proc(hWnd: HWND, lpClassName: LPWSTR, nMaxCount: c_int) -> c_int ---
|
||||
|
||||
RegisterClassA :: proc(lpWndClass: ^WNDCLASSA) -> ATOM ---
|
||||
RegisterClassW :: proc(lpWndClass: ^WNDCLASSW) -> ATOM ---
|
||||
RegisterClassExA :: proc(^WNDCLASSEXA) -> ATOM ---
|
||||
RegisterClassExW :: proc(^WNDCLASSEXW) -> ATOM ---
|
||||
|
||||
CreateWindowExA :: proc(
|
||||
dwExStyle: DWORD,
|
||||
lpClassName: LPCSTR,
|
||||
lpWindowName: LPCSTR,
|
||||
dwStyle: DWORD,
|
||||
X: c_int,
|
||||
Y: c_int,
|
||||
nWidth: c_int,
|
||||
nHeight: c_int,
|
||||
hWndParent: HWND,
|
||||
hMenu: HMENU,
|
||||
hInstance: HINSTANCE,
|
||||
lpParam: LPVOID,
|
||||
) -> HWND ---
|
||||
CreateWindowExW :: proc(
|
||||
dwExStyle: DWORD,
|
||||
lpClassName: LPCWSTR,
|
||||
@@ -67,11 +44,9 @@ foreign user32 {
|
||||
SetActiveWindow :: proc(hWnd: HWND) -> HWND ---
|
||||
GetActiveWindow :: proc() -> HWND ---
|
||||
|
||||
GetMessageA :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) -> BOOL ---
|
||||
GetMessageW :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) -> BOOL ---
|
||||
|
||||
TranslateMessage :: proc(lpMsg: ^MSG) -> BOOL ---
|
||||
DispatchMessageA :: proc(lpMsg: ^MSG) -> LRESULT ---
|
||||
DispatchMessageW :: proc(lpMsg: ^MSG) -> LRESULT ---
|
||||
|
||||
PeekMessageA :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) -> BOOL ---
|
||||
@@ -141,10 +116,8 @@ foreign user32 {
|
||||
GetKeyState :: proc(nVirtKey: c_int) -> SHORT ---
|
||||
GetAsyncKeyState :: proc(vKey: c_int) -> SHORT ---
|
||||
|
||||
MapVirtualKeyA :: proc(uCode: UINT, uMapType: UINT) -> UINT ---
|
||||
MapVirtualKeyW :: proc(uCode: UINT, uMapType: UINT) -> UINT ---
|
||||
|
||||
SetWindowsHookExA :: proc(idHook: c_int, lpfn: HOOKPROC, hmod: HINSTANCE, dwThreadId: DWORD) -> HHOOK ---
|
||||
SetWindowsHookExW :: proc(idHook: c_int, lpfn: HOOKPROC, hmod: HINSTANCE, dwThreadId: DWORD) -> HHOOK ---
|
||||
UnhookWindowsHookEx :: proc(hhk: HHOOK) -> BOOL ---
|
||||
CallNextHookEx :: proc(hhk: HHOOK, nCode: c_int, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
|
||||
@@ -152,9 +125,9 @@ foreign user32 {
|
||||
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 ---
|
||||
// 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 ---
|
||||
// MessageBoxExA :: proc(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT, wLanguageId: WORD) -> c_int ---
|
||||
MessageBoxExW :: proc(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT, wLanguageId: WORD) -> c_int ---
|
||||
|
||||
ClipCursor :: proc(lpRect: LPRECT) -> BOOL ---
|
||||
@@ -163,35 +136,6 @@ foreign user32 {
|
||||
SetCursor :: proc(hCursor: HCURSOR) -> HCURSOR ---
|
||||
}
|
||||
|
||||
CreateWindowA :: #force_inline proc "stdcall" (
|
||||
lpClassName: LPCSTR,
|
||||
lpWindowName: LPCSTR,
|
||||
dwStyle: DWORD,
|
||||
X: c_int,
|
||||
Y: c_int,
|
||||
nWidth: c_int,
|
||||
nHeight: c_int,
|
||||
hWndParent: HWND,
|
||||
hMenu: HMENU,
|
||||
hInstance: HINSTANCE,
|
||||
lpParam: LPVOID,
|
||||
) -> HWND {
|
||||
return CreateWindowExA(
|
||||
0,
|
||||
lpClassName,
|
||||
lpWindowName,
|
||||
dwStyle,
|
||||
X,
|
||||
Y,
|
||||
nWidth,
|
||||
nHeight,
|
||||
hWndParent,
|
||||
hMenu,
|
||||
hInstance,
|
||||
lpParam,
|
||||
)
|
||||
}
|
||||
|
||||
CreateWindowW :: #force_inline proc "stdcall" (
|
||||
lpClassName: LPCTSTR,
|
||||
lpWindowName: LPCTSTR,
|
||||
@@ -224,25 +168,17 @@ CreateWindowW :: #force_inline proc "stdcall" (
|
||||
when ODIN_ARCH == .amd64 {
|
||||
@(default_calling_convention="stdcall")
|
||||
foreign user32 {
|
||||
GetClassLongPtrA :: proc(hWnd: HWND, nIndex: c_int) -> ULONG_PTR ---
|
||||
GetClassLongPtrW :: proc(hWnd: HWND, nIndex: c_int) -> ULONG_PTR ---
|
||||
SetClassLongPtrA :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG_PTR) -> ULONG_PTR ---
|
||||
SetClassLongPtrW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG_PTR) -> ULONG_PTR ---
|
||||
|
||||
GetWindowLongPtrA :: proc(hWnd: HWND, nIndex: c_int) -> LONG_PTR ---
|
||||
GetWindowLongPtrW :: proc(hWnd: HWND, nIndex: c_int) -> LONG_PTR ---
|
||||
SetWindowLongPtrA :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG_PTR) -> LONG_PTR ---
|
||||
SetWindowLongPtrW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG_PTR) -> LONG_PTR ---
|
||||
}
|
||||
} else when ODIN_ARCH == .i386 {
|
||||
GetClassLongPtrA :: GetClassLongA
|
||||
GetClassLongPtrW :: GetClassLongW
|
||||
SetClassLongPtrA :: SetClassLongA
|
||||
SetClassLongPtrW :: SetClassLongW
|
||||
|
||||
GetWindowLongPtrA :: GetWindowLongA
|
||||
GetWindowLongPtrW :: GetWindowLongW
|
||||
SetWindowLongPtrA :: GetWindowLongA
|
||||
SetWindowLongPtrW :: GetWindowLongW
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user