diff options
| author | hikari <ftphikari@gmail.com> | 2022-03-21 18:38:52 +0200 |
|---|---|---|
| committer | hikari <ftphikari@gmail.com> | 2022-03-21 18:44:31 +0200 |
| commit | e48c0eee74b477d64d4c759f800906b95a6fc8f3 (patch) | |
| tree | 0820c36374cbc93fdb0aa17148e49ada1d9e0288 /core/sys/windows/user32.odin | |
| parent | 559fcfa2917d448b94899fc0ff3a921e8d6c4e0d (diff) | |
sys/windows: added rudimentary User32.lib bindings
Diffstat (limited to 'core/sys/windows/user32.odin')
| -rw-r--r-- | core/sys/windows/user32.odin | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin new file mode 100644 index 000000000..b6fef5444 --- /dev/null +++ b/core/sys/windows/user32.odin @@ -0,0 +1,82 @@ +// +build windows +package sys_windows + +foreign import user32 "system:User32.lib" + +@(default_calling_convention="stdcall") +foreign user32 { + 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, + lpWindowName: LPCWSTR, + dwStyle: DWORD, + X: c_int, + Y: c_int, + nWidth: c_int, + nHeight: c_int, + hWndParent: HWND, + hMenu: HMENU, + hInstance: HINSTANCE, + lpParam: LPVOID, + ) -> HWND --- + + DestroyWindow :: proc(hWnd: HWND) -> BOOL --- + ShowWindow :: proc(hWnd: HWND, nCmdShow: c_int) -> BOOL --- + + 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 --- + PeekMessageW :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) -> BOOL --- + + PostMessageA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL --- + PostMessageW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL --- + SendMessageA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT --- + SendMessageW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT --- + + PostThreadMessageA :: proc(idThread: DWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL --- + PostThreadMessageW :: proc(idThread: DWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL --- + + DefWindowProcA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT --- + DefWindowProcW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT --- + + FindWindowExA :: proc(hWndParent: HWND, hWndChildAfter: HWND, lpszClass: LPCSTR, lpszWindow: LPCSTR) -> HWND --- + FindWindowExW :: proc(hWndParent: HWND, hWndChildAfter: HWND, lpszClass: LPCWSTR, lpszWindow: LPCWSTR) -> HWND --- + + LoadIconA :: proc(hInstance: HINSTANCE, lpIconName: LPCSTR) -> HICON --- + LoadIconW :: proc(hInstance: HINSTANCE, lpIconName: LPCWSTR) -> HICON --- + LoadCursorA :: proc(hInstance: HINSTANCE, lpCursorName: LPCSTR) -> HCURSOR --- + LoadCursorW :: proc(hInstance: HINSTANCE, lpCursorName: LPCWSTR) -> HCURSOR --- + + GetClientRect :: proc(hWnd: HWND, lpRect: ^RECT) -> BOOL --- + + GetWindowDC :: proc(hWnd: HWND) -> HDC --- + GetDC :: proc(hWnd: HWND) -> HDC --- + ReleaseDC :: proc(hWnd: HWND, hDC: HDC) -> c_int --- + + BeginPaint :: proc(hWnd: HWND, lpPaint: ^PAINTSTRUCT) -> HDC --- + EndPaint :: proc(hWnd: HWND, lpPaint: ^PAINTSTRUCT) -> BOOL --- +} |