sys/windows: add several functions and constants

This commit is contained in:
hikari
2022-06-03 22:12:43 +03:00
parent 592e9afa5f
commit 176954a6d8
3 changed files with 63 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ HBITMAP :: distinct HANDLE
HGLOBAL :: distinct HANDLE
HHOOK :: distinct HANDLE
HKEY :: distinct HANDLE
HDESK :: distinct HANDLE
BOOL :: distinct b32
BYTE :: distinct u8
BOOLEAN :: distinct b8
@@ -415,6 +416,40 @@ REG_RESOURCE_REQUIREMENTS_LIST :: 10
REG_QWORD :: 11
REG_QWORD_LITTLE_ENDIAN :: 11
BSMINFO :: struct {
cbSize: UINT,
hdesk: HDESK,
hwnd: HWND,
luid: LUID,
}
PBSMINFO :: ^BSMINFO
// Broadcast Special Message Recipient list
BSM_ALLCOMPONENTS :: 0x00000000
BSM_VXDS :: 0x00000001
BSM_NETDRIVER :: 0x00000002
BSM_INSTALLABLEDRIVERS :: 0x00000004
BSM_APPLICATIONS :: 0x00000008
BSM_ALLDESKTOPS :: 0x00000010
// Broadcast Special Message Flags
BSF_QUERY :: 0x00000001
BSF_IGNORECURRENTTASK :: 0x00000002
BSF_FLUSHDISK :: 0x00000004
BSF_NOHANG :: 0x00000008
BSF_POSTMESSAGE :: 0x00000010
BSF_FORCEIFHUNG :: 0x00000020
BSF_NOTIMEOUTIFNOTHUNG :: 0x00000040
BSF_ALLOWSFW :: 0x00000080
BSF_SENDNOTIFYMESSAGE :: 0x00000100
BSF_RETURNHDESK :: 0x00000200
BSF_LUID :: 0x00000400
BROADCAST_QUERY_DENY :: 0x424D5144
// Special HWND value for use with PostMessage() and SendMessage()
HWND_BROADCAST :: HWND(uintptr(0xffff))
HWND_MESSAGE :: HWND(~uintptr(0) - 2) // -3
PTIMERAPCROUTINE :: #type proc "stdcall" (lpArgToCompletionRoutine: LPVOID, dwTimerLowValue, dwTimerHighValue: DWORD)

View File

@@ -134,6 +134,33 @@ foreign user32 {
GetCursorPos :: proc(lpPoint: LPPOINT) -> BOOL ---
SetCursorPos :: proc(X: c_int, Y: c_int) -> BOOL ---
SetCursor :: proc(hCursor: HCURSOR) -> HCURSOR ---
BroadcastSystemMessageW :: proc(
flags: DWORD,
lpInfo: LPDWORD,
Msg: UINT,
wParam: WPARAM,
lParam: LPARAM,
) -> c_long ---
BroadcastSystemMessageExW :: proc(
flags: DWORD,
lpInfo: LPDWORD,
Msg: UINT,
wParam: WPARAM,
lParam: LPARAM,
pbsmInfo: PBSMINFO,
) -> c_long ---
SendMessageTimeoutW :: proc(
hWnd: HWND,
Msg: UINT,
wParam: WPARAM,
lParam: LPARAM,
fuFlags: UINT,
uTimeout: UINT,
lpdwResult: PDWORD_PTR,
) -> LRESULT ---
}
CreateWindowW :: #force_inline proc "stdcall" (

View File

@@ -25,6 +25,7 @@ WM_ENDSESSION :: 0x0016
WM_SHOWWINDOW :: 0x0018
WM_CTLCOLOR :: 0x0019
WM_WININICHANGE :: 0x001a
WM_SETTINGCHANGE :: WM_WININICHANGE
WM_DEVMODECHANGE :: 0x001b
WM_ACTIVATEAPP :: 0x001c
WM_FONTCHANGE :: 0x001d