user32.odin 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. #+build windows
  2. package sys_windows
  3. import "base:intrinsics"
  4. foreign import user32 "system:User32.lib"
  5. @(default_calling_convention="system")
  6. foreign user32 {
  7. GetClassInfoW :: proc(hInstance: HINSTANCE, lpClassName: LPCWSTR, lpWndClass: ^WNDCLASSW) -> BOOL ---
  8. GetClassInfoExW :: proc(hInstance: HINSTANCE, lpszClass: LPCWSTR, lpwcx: ^WNDCLASSEXW) -> BOOL ---
  9. GetClassLongW :: proc(hWnd: HWND, nIndex: INT) -> DWORD ---
  10. SetClassLongW :: proc(hWnd: HWND, nIndex: INT, dwNewLong: LONG) -> DWORD ---
  11. GetWindowLongW :: proc(hWnd: HWND, nIndex: INT) -> LONG ---
  12. SetWindowLongW :: proc(hWnd: HWND, nIndex: INT, dwNewLong: LONG) -> LONG ---
  13. GetClassNameW :: proc(hWnd: HWND, lpClassName: LPWSTR, nMaxCount: INT) -> INT ---
  14. GetParent :: proc(hWnd: HWND) -> HWND ---
  15. SetWinEventHook :: proc(
  16. eventMin, eventMax: DWORD,
  17. hmodWinEventProc: HMODULE,
  18. pfnWinEvenProc: WINEVENTPROC,
  19. idProcess, idThread: DWORD,
  20. dwFlags: WinEventFlags,
  21. ) -> HWINEVENTHOOK ---
  22. IsChild :: proc(hWndParent, hWnd: HWND) -> BOOL ---
  23. RegisterClassW :: proc(lpWndClass: ^WNDCLASSW) -> ATOM ---
  24. RegisterClassExW :: proc(^WNDCLASSEXW) -> ATOM ---
  25. UnregisterClassW :: proc(lpClassName: LPCWSTR, hInstance: HINSTANCE) -> BOOL ---
  26. CreateWindowExW :: proc(
  27. dwExStyle: DWORD,
  28. lpClassName: LPCWSTR,
  29. lpWindowName: LPCWSTR,
  30. dwStyle: DWORD,
  31. X, Y, nWidth, nHeight: INT,
  32. hWndParent: HWND,
  33. hMenu: HMENU,
  34. hInstance: HINSTANCE,
  35. lpParam: LPVOID,
  36. ) -> HWND ---
  37. DestroyWindow :: proc(hWnd: HWND) -> BOOL ---
  38. ShowWindow :: proc(hWnd: HWND, nCmdShow: INT) -> BOOL ---
  39. IsWindow :: proc(hWnd: HWND) -> BOOL ---
  40. IsWindowVisible :: proc(hwnd: HWND) -> BOOL ---
  41. IsWindowEnabled :: proc(hwnd: HWND) -> BOOL ---
  42. IsIconic :: proc(hwnd: HWND) -> BOOL ---
  43. BringWindowToTop :: proc(hWnd: HWND) -> BOOL ---
  44. GetTopWindow :: proc(hWnd: HWND) -> HWND ---
  45. SetForegroundWindow :: proc(hWnd: HWND) -> BOOL ---
  46. GetForegroundWindow :: proc() -> HWND ---
  47. GetDesktopWindow :: proc() -> HWND ---
  48. UpdateWindow :: proc(hWnd: HWND) -> BOOL ---
  49. SetActiveWindow :: proc(hWnd: HWND) -> HWND ---
  50. GetActiveWindow :: proc() -> HWND ---
  51. RedrawWindow :: proc(hwnd: HWND, lprcUpdate: LPRECT, hrgnUpdate: HRGN, flags: RedrawWindowFlags) -> BOOL ---
  52. SetParent :: proc(hWndChild: HWND, hWndNewParent: HWND) -> HWND ---
  53. SetPropW :: proc(hWnd: HWND, lpString: LPCWSTR, hData: HANDLE) -> BOOL ---
  54. GetPropW :: proc(hWnd: HWND, lpString: LPCWSTR) -> HANDLE ---
  55. RemovePropW :: proc(hWnd: HWND, lpString: LPCWSTR) -> HANDLE ---
  56. EnumPropsW :: proc(hWnd: HWND, lpEnumFunc: PROPENUMPROCW) -> INT ---
  57. EnumPropsExW :: proc(hWnd: HWND, lpEnumFunc: PROPENUMPROCW, lParam: LPARAM) -> INT ---
  58. GetMessageW :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) -> INT ---
  59. TranslateMessage :: proc(lpMsg: ^MSG) -> BOOL ---
  60. DispatchMessageW :: proc(lpMsg: ^MSG) -> LRESULT ---
  61. WaitMessage :: proc() -> BOOL ---
  62. MsgWaitForMultipleObjects :: proc(nCount: DWORD, pHandles: ^HANDLE, fWaitAll: BOOL, dwMilliseconds: DWORD, dwWakeMask: DWORD) -> DWORD ---
  63. PeekMessageA :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) -> BOOL ---
  64. PeekMessageW :: proc(lpMsg: ^MSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) -> BOOL ---
  65. PostMessageA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  66. PostMessageW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  67. SendMessageA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  68. SendMessageW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  69. PostThreadMessageA :: proc(idThread: DWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  70. PostThreadMessageW :: proc(idThread: DWORD, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> BOOL ---
  71. PostQuitMessage :: proc(nExitCode: INT) ---
  72. GetQueueStatus :: proc(flags: UINT) -> DWORD ---
  73. DefWindowProcA :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  74. DefWindowProcW :: proc(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  75. FindWindowA :: proc(lpClassName: LPCSTR, lpWindowName: LPCSTR) -> HWND ---
  76. FindWindowW :: proc(lpClassName: LPCWSTR, lpWindowName: LPCWSTR) -> HWND ---
  77. FindWindowExA :: proc(hWndParent: HWND, hWndChildAfter: HWND, lpszClass: LPCSTR, lpszWindow: LPCSTR) -> HWND ---
  78. FindWindowExW :: proc(hWndParent: HWND, hWndChildAfter: HWND, lpszClass: LPCWSTR, lpszWindow: LPCWSTR) -> HWND ---
  79. LoadIconA :: proc(hInstance: HINSTANCE, lpIconName: LPCSTR) -> HICON ---
  80. LoadIconW :: proc(hInstance: HINSTANCE, lpIconName: LPCWSTR) -> HICON ---
  81. GetIconInfoExW :: proc(hIcon: HICON, piconinfo: PICONINFOEXW) -> BOOL ---
  82. LoadCursorA :: proc(hInstance: HINSTANCE, lpCursorName: LPCSTR) -> HCURSOR ---
  83. LoadCursorW :: proc(hInstance: HINSTANCE, lpCursorName: LPCWSTR) -> HCURSOR ---
  84. LoadImageW :: proc(hInst: HINSTANCE, name: LPCWSTR, type: UINT, cx, cy: INT, fuLoad: UINT) -> HANDLE ---
  85. CreateIcon :: proc(hInstance: HINSTANCE, nWidth, nHeight: INT, cPlanes: BYTE, cBitsPixel: BYTE, lpbANDbits: PBYTE, lpbXORbits: PBYTE) -> HICON ---
  86. CreateIconFromResource :: proc(presbits: PBYTE, dwResSize: DWORD, fIcon: BOOL, dwVer: DWORD) -> HICON ---
  87. DestroyIcon :: proc(hIcon: HICON) -> BOOL ---
  88. DrawIcon :: proc(hDC: HDC, X, Y: INT, hIcon: HICON) -> BOOL ---
  89. CreateCursor :: proc(hInst: HINSTANCE, xHotSpot, yHotSpot, nWidth, nHeight: INT, pvANDPlane: PVOID, pvXORPlane: PVOID) -> HCURSOR ---
  90. DestroyCursor :: proc(hCursor: HCURSOR) -> BOOL ---
  91. GetWindowRect :: proc(hWnd: HWND, lpRect: LPRECT) -> BOOL ---
  92. GetClientRect :: proc(hWnd: HWND, lpRect: LPRECT) -> BOOL ---
  93. ClientToScreen :: proc(hWnd: HWND, lpPoint: LPPOINT) -> BOOL ---
  94. ScreenToClient :: proc(hWnd: HWND, lpPoint: LPPOINT) -> BOOL ---
  95. SetWindowPos :: proc(hWnd: HWND, hWndInsertAfter: HWND, X, Y, cx, cy: INT, uFlags: UINT) -> BOOL ---
  96. MoveWindow :: proc(hWnd: HWND, X, Y, hWidth, hHeight: INT, bRepaint: BOOL) -> BOOL ---
  97. GetSystemMetrics :: proc(nIndex: INT) -> INT ---
  98. AdjustWindowRect :: proc(lpRect: LPRECT, dwStyle: DWORD, bMenu: BOOL) -> BOOL ---
  99. AdjustWindowRectEx :: proc(lpRect: LPRECT, dwStyle: DWORD, bMenu: BOOL, dwExStyle: DWORD) -> BOOL ---
  100. AdjustWindowRectExForDpi :: proc(lpRect: LPRECT, dwStyle: DWORD, bMenu: BOOL, dwExStyle: DWORD, dpi: UINT) -> BOOL ---
  101. SystemParametersInfoW :: proc(uiAction, uiParam: UINT, pvParam: PVOID, fWinIni: UINT) -> BOOL ---
  102. GetMonitorInfoW :: proc(hMonitor: HMONITOR, lpmi: LPMONITORINFO) -> BOOL ---
  103. GetWindowDC :: proc(hWnd: HWND) -> HDC ---
  104. GetDC :: proc(hWnd: HWND) -> HDC ---
  105. GetDCEx :: proc(hWnd: HWND, hrgnClip: HRGN, flags: DWORD) -> HDC ---
  106. ReleaseDC :: proc(hWnd: HWND, hDC: HDC) -> INT ---
  107. GetDlgCtrlID :: proc(hWnd: HWND) -> INT ---
  108. GetDlgItem :: proc(hDlg: HWND, nIDDlgItem: INT) -> HWND ---
  109. CreateMenu :: proc() -> HMENU ---
  110. CreatePopupMenu :: proc() -> HMENU ---
  111. DeleteMenu :: proc(hMenu: HMENU, uPosition: UINT, uFlags: UINT) -> BOOL ---
  112. DestroyMenu :: proc(hMenu: HMENU) -> BOOL ---
  113. InsertMenuW :: proc(hMenu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT_PTR, lpNewItem: LPCWSTR) -> BOOL ---
  114. AppendMenuW :: proc(hMenu: HMENU, uFlags: UINT, uIDNewItem: UINT_PTR, lpNewItem: LPCWSTR) -> BOOL ---
  115. GetMenu :: proc(hWnd: HWND) -> HMENU ---
  116. SetMenu :: proc(hWnd: HWND, hMenu: HMENU) -> BOOL ---
  117. TrackPopupMenu :: proc(hMenu: HMENU, uFlags: UINT, x, y: INT, nReserved: INT, hWnd: HWND, prcRect: ^RECT) -> INT ---
  118. RegisterWindowMessageW :: proc(lpString: LPCWSTR) -> UINT ---
  119. CreateAcceleratorTableW :: proc(paccel: LPACCEL, cAccel: INT) -> HACCEL ---
  120. DestroyAcceleratorTable :: proc(hAccel: HACCEL) -> BOOL ---
  121. LoadAcceleratorsW :: proc(hInstance: HINSTANCE, lpTableName: LPCWSTR) -> HACCEL ---
  122. TranslateAcceleratorW :: proc(hWnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG) -> INT ---
  123. CopyAcceleratorTableW :: proc(hAccelSrc: HACCEL, lpAccelDst: LPACCEL, cAccelEntries: INT) -> INT ---
  124. InsertMenuItemW :: proc(hmenu: HMENU, item: UINT, fByPosition: BOOL, lpmi: LPMENUITEMINFOW) -> BOOL ---
  125. GetMenuItemInfoW :: proc(hmenu: HMENU, item: UINT, fByPosition: BOOL, lpmii: LPMENUITEMINFOW) -> BOOL ---
  126. SetMenuItemInfoW :: proc(hmenu: HMENU, item: UINT, fByPositon: BOOL, lpmii: LPMENUITEMINFOW) -> BOOL ---
  127. GetMenuDefaultItem :: proc(hMenu: HMENU, fByPos: UINT, gmdiFlags: UINT) -> UINT ---
  128. SetMenuDefaultItem :: proc(hMenu: HMENU, uItem: UINT, fByPos: UINT) -> BOOL ---
  129. GetMenuItemRect :: proc(hWnd: HWND, hMenu: HMENU, uItem: UINT, lprcItem: LPRECT) -> c_int ---
  130. GetUpdateRect :: proc(hWnd: HWND, lpRect: LPRECT, bErase: BOOL) -> BOOL ---
  131. ValidateRect :: proc(hWnd: HWND, lpRect: ^RECT) -> BOOL ---
  132. InvalidateRect :: proc(hWnd: HWND, lpRect: ^RECT, bErase: BOOL) -> BOOL ---
  133. BeginPaint :: proc(hWnd: HWND, lpPaint: ^PAINTSTRUCT) -> HDC ---
  134. EndPaint :: proc(hWnd: HWND, lpPaint: ^PAINTSTRUCT) -> BOOL ---
  135. GetCapture :: proc() -> HWND ---
  136. SetCapture :: proc(hWnd: HWND) -> HWND ---
  137. ReleaseCapture :: proc() -> BOOL ---
  138. TrackMouseEvent :: proc(lpEventTrack: LPTRACKMOUSEEVENT) -> BOOL ---
  139. GetKeyState :: proc(nVirtKey: INT) -> SHORT ---
  140. GetAsyncKeyState :: proc(vKey: INT) -> SHORT ---
  141. GetKeyboardState :: proc(lpKeyState: PBYTE) -> BOOL ---
  142. MapVirtualKeyW :: proc(uCode: UINT, uMapType: UINT) -> UINT ---
  143. ToUnicode :: proc(nVirtKey: UINT, wScanCode: UINT, lpKeyState: ^BYTE, pwszBuff: LPWSTR, cchBuff: INT, wFlags: UINT) -> INT ---
  144. SetWindowsHookExW :: proc(idHook: INT, lpfn: HOOKPROC, hmod: HINSTANCE, dwThreadId: DWORD) -> HHOOK ---
  145. UnhookWindowsHookEx :: proc(hhk: HHOOK) -> BOOL ---
  146. CallNextHookEx :: proc(hhk: HHOOK, nCode: INT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  147. SetTimer :: proc(hWnd: HWND, nIDEvent: UINT_PTR, uElapse: UINT, lpTimerFunc: TIMERPROC) -> UINT_PTR ---
  148. KillTimer :: proc(hWnd: HWND, uIDEvent: UINT_PTR) -> BOOL ---
  149. // MessageBoxA :: proc(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT) -> INT ---
  150. MessageBoxW :: proc(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT) -> INT ---
  151. // MessageBoxExA :: proc(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT, wLanguageId: WORD) -> INT ---
  152. MessageBoxExW :: proc(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT, wLanguageId: WORD) -> INT ---
  153. ClipCursor :: proc(lpRect: LPRECT) -> BOOL ---
  154. GetCursorPos :: proc(lpPoint: LPPOINT) -> BOOL ---
  155. SetCursorPos :: proc(X, Y: INT) -> BOOL ---
  156. SetCursor :: proc(hCursor: HCURSOR) -> HCURSOR ---
  157. when !intrinsics.is_package_imported("raylib") {
  158. ShowCursor :: proc(bShow: BOOL) -> INT ---
  159. }
  160. EnumDisplayDevicesW :: proc (lpDevice: LPCWSTR, iDevNum: DWORD, lpDisplayDevice: PDISPLAY_DEVICEW, dwFlags: DWORD) -> BOOL ---
  161. EnumDisplaySettingsW :: proc(lpszDeviceName: LPCWSTR, iModeNum: DWORD, lpDevMode: ^DEVMODEW) -> BOOL ---
  162. MonitorFromPoint :: proc(pt: POINT, dwFlags: Monitor_From_Flags) -> HMONITOR ---
  163. MonitorFromRect :: proc(lprc: LPRECT, dwFlags: Monitor_From_Flags) -> HMONITOR ---
  164. MonitorFromWindow :: proc(hwnd: HWND, dwFlags: Monitor_From_Flags) -> HMONITOR ---
  165. EnumDisplayMonitors :: proc(hdc: HDC, lprcClip: LPRECT, lpfnEnum: Monitor_Enum_Proc, dwData: LPARAM) -> BOOL ---
  166. EnumWindows :: proc(lpEnumFunc: Window_Enum_Proc, lParam: LPARAM) -> BOOL ---
  167. IsProcessDPIAware :: proc() -> BOOL ---
  168. SetProcessDPIAware :: proc() -> BOOL ---
  169. SetThreadDpiAwarenessContext :: proc(dpiContext: DPI_AWARENESS_CONTEXT) -> DPI_AWARENESS_CONTEXT ---
  170. GetThreadDpiAwarenessContext :: proc() -> DPI_AWARENESS_CONTEXT ---
  171. GetWindowDpiAwarenessContext :: proc(hwnd: HWND) -> DPI_AWARENESS_CONTEXT ---
  172. GetDpiFromDpiAwarenessContext :: proc(value: DPI_AWARENESS_CONTEXT) -> UINT ---
  173. GetDpiForWindow :: proc(hwnd: HWND) -> UINT ---
  174. SetProcessDpiAwarenessContext :: proc(value: DPI_AWARENESS_CONTEXT) -> BOOL ---
  175. BroadcastSystemMessageW :: proc(
  176. flags: DWORD,
  177. lpInfo: LPDWORD,
  178. Msg: UINT,
  179. wParam: WPARAM,
  180. lParam: LPARAM,
  181. ) -> c_long ---
  182. BroadcastSystemMessageExW :: proc(
  183. flags: DWORD,
  184. lpInfo: LPDWORD,
  185. Msg: UINT,
  186. wParam: WPARAM,
  187. lParam: LPARAM,
  188. pbsmInfo: PBSMINFO,
  189. ) -> c_long ---
  190. SendMessageTimeoutW :: proc(
  191. hWnd: HWND,
  192. Msg: UINT,
  193. wParam: WPARAM,
  194. lParam: LPARAM,
  195. fuFlags: UINT,
  196. uTimeout: UINT,
  197. lpdwResult: PDWORD_PTR,
  198. ) -> LRESULT ---
  199. GetSysColor :: proc(nIndex: INT) -> DWORD ---
  200. GetSysColorBrush :: proc(nIndex: INT) -> HBRUSH ---
  201. SetSysColors :: proc(cElements: INT, lpaElements: ^INT, lpaRgbValues: ^COLORREF) -> BOOL ---
  202. MessageBeep :: proc(uType: UINT) -> BOOL ---
  203. IsDialogMessageW :: proc(hDlg: HWND, lpMsg: LPMSG) -> BOOL ---
  204. GetWindowTextLengthW :: proc(hWnd: HWND) -> INT ---
  205. GetWindowTextW :: proc(hWnd: HWND, lpString: LPWSTR, nMaxCount: INT) -> INT ---
  206. SetWindowTextW :: proc(hWnd: HWND, lpString: LPCWSTR) -> BOOL ---
  207. CallWindowProcW :: proc(lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT ---
  208. EnableWindow :: proc(hWnd: HWND, bEnable: BOOL) -> BOOL ---
  209. DefRawInputProc :: proc(paRawInput: ^PRAWINPUT, nInput: INT, cbSizeHeader: UINT) -> LRESULT ---
  210. GetRawInputBuffer :: proc(pRawInput: PRAWINPUT, pcbSize: PUINT, cbSizeHeader: UINT) -> UINT ---
  211. GetRawInputData :: proc(hRawInput: HRAWINPUT, uiCommand: UINT, pData: LPVOID, pcbSize: PUINT, cbSizeHeader: UINT) -> UINT ---
  212. GetRawInputDeviceInfoW :: proc(hDevice: HANDLE, uiCommand: UINT, pData: LPVOID, pcbSize: PUINT) -> UINT ---
  213. GetRawInputDeviceList :: proc(pRawInputDeviceList: PRAWINPUTDEVICELIST, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
  214. GetRegisteredRawInputDevices :: proc(pRawInputDevices: PRAWINPUTDEVICE, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
  215. RegisterRawInputDevices :: proc(pRawInputDevices: PCRAWINPUTDEVICE, uiNumDevices: UINT, cbSize: UINT) -> BOOL ---
  216. SendInput :: proc(cInputs: UINT, pInputs: [^]INPUT, cbSize: INT) -> UINT ---
  217. SetLayeredWindowAttributes :: proc(hWnd: HWND, crKey: COLORREF, bAlpha: BYTE, dwFlags: DWORD) -> BOOL ---
  218. FillRect :: proc(hDC: HDC, lprc: ^RECT, hbr: HBRUSH) -> int ---
  219. EqualRect :: proc(lprc1, lprc2: ^RECT) -> BOOL ---
  220. OffsetRect :: proc(lprc1: ^RECT, dx, dy: INT) -> BOOL ---
  221. InflateRect :: proc(lprc1: ^RECT, dx, dy: INT) -> BOOL ---
  222. IntersectRect :: proc(lprcDst, lprcSrc1, lprcSrc2: ^RECT) -> BOOL ---
  223. SubtractRect :: proc(lprcDst, lprcSrc1, lprcSrc2: ^RECT) -> BOOL ---
  224. UnionRect :: proc(lprcDst, lprcSrc1, lprcSrc2: ^RECT) -> BOOL ---
  225. IsRectEmpty :: proc(lprc: ^RECT) -> BOOL ---
  226. SetRectEmpty :: proc(lprc: ^RECT) -> BOOL ---
  227. CopyRect :: proc(lprcDst, lprcSrc: ^RECT) -> BOOL ---
  228. GetWindowInfo :: proc(hwnd: HWND, pwi: PWINDOWINFO) -> BOOL ---
  229. GetWindowPlacement :: proc(hWnd: HWND, lpwndpl: ^WINDOWPLACEMENT) -> BOOL ---
  230. SetWindowPlacement :: proc(hwnd: HWND, lpwndpl: ^WINDOWPLACEMENT) -> BOOL ---
  231. SetWindowRgn :: proc(hWnd: HWND, hRgn: HRGN, bRedraw: BOOL) -> int ---
  232. CreateRectRgnIndirect :: proc(lprect: ^RECT) -> HRGN ---
  233. GetSystemMetricsForDpi :: proc(nIndex: int, dpi: UINT) -> int ---
  234. GetCursorInfo :: proc(pci: PCURSORINFO) -> BOOL ---
  235. GetSystemMenu :: proc(hWnd: HWND, bRevert: BOOL) -> HMENU ---
  236. EnableMenuItem :: proc(hMenu: HMENU, uIDEnableItem: UINT, uEnable: UINT) -> BOOL ---
  237. MenuItemFromPoint :: proc(hWnd: HWND, hMenu: HMENU, ptScreen: POINT) -> INT ---
  238. DrawTextW :: proc(hdc: HDC, lpchText: LPCWSTR, cchText: INT, lprc: LPRECT, format: DrawTextFormat) -> INT ---
  239. DrawTextExW :: proc(hdc: HDC, lpchText: LPCWSTR, cchText: INT, lprc: LPRECT, format: DrawTextFormat, lpdtp: PDRAWTEXTPARAMS) -> INT ---
  240. GetLocaleInfoEx :: proc(lpLocaleName: LPCWSTR, LCType: LCTYPE, lpLCData: LPWSTR, cchData: INT) -> INT ---
  241. IsValidLocaleName :: proc(lpLocaleName: LPCWSTR) -> BOOL ---
  242. ResolveLocaleName :: proc(lpNameToResolve: LPCWSTR, lpLocaleName: LPWSTR, cchLocaleName: INT) -> INT ---
  243. IsValidCodePage :: proc(CodePage: UINT) -> BOOL ---
  244. GetACP :: proc() -> CODEPAGE ---
  245. GetCPInfoExW :: proc(CodePage: CODEPAGE, dwFlags: DWORD, lpCPInfoEx: LPCPINFOEXW) -> BOOL ---
  246. GetProcessWindowStation :: proc() -> HWINSTA ---
  247. GetUserObjectInformationW :: proc(hObj: HANDLE, nIndex: GetUserObjectInformationFlags, pvInfo: PVOID, nLength: DWORD, lpnLengthNeeded: LPDWORD) -> BOOL ---
  248. OpenClipboard :: proc(hWndNewOwner: HWND) -> BOOL ---
  249. CloseClipboard :: proc() -> BOOL ---
  250. GetClipboardData :: proc(uFormat: UINT) -> HANDLE ---
  251. SetClipboardData :: proc(uFormat: UINT, hMem: HANDLE) -> HANDLE ---
  252. IsClipboardFormatAvailable :: proc(format: UINT) -> BOOL ---
  253. EmptyClipboard :: proc() -> BOOL ---
  254. }
  255. CreateWindowW :: #force_inline proc "system" (
  256. lpClassName: LPCTSTR,
  257. lpWindowName: LPCTSTR,
  258. dwStyle: DWORD,
  259. X: INT,
  260. Y: INT,
  261. nWidth: INT,
  262. nHeight: INT,
  263. hWndParent: HWND,
  264. hMenu: HMENU,
  265. hInstance: HINSTANCE,
  266. lpParam: LPVOID,
  267. ) -> HWND {
  268. return CreateWindowExW(
  269. 0,
  270. lpClassName,
  271. lpWindowName,
  272. dwStyle,
  273. X,
  274. Y,
  275. nWidth,
  276. nHeight,
  277. hWndParent,
  278. hMenu,
  279. hInstance,
  280. lpParam,
  281. )
  282. }
  283. when ODIN_ARCH == .amd64 {
  284. @(default_calling_convention="system")
  285. foreign user32 {
  286. GetClassLongPtrW :: proc(hWnd: HWND, nIndex: INT) -> ULONG_PTR ---
  287. SetClassLongPtrW :: proc(hWnd: HWND, nIndex: INT, dwNewLong: LONG_PTR) -> ULONG_PTR ---
  288. GetWindowLongPtrW :: proc(hWnd: HWND, nIndex: INT) -> LONG_PTR ---
  289. SetWindowLongPtrW :: proc(hWnd: HWND, nIndex: INT, dwNewLong: LONG_PTR) -> LONG_PTR ---
  290. }
  291. } else when ODIN_ARCH == .i386 {
  292. GetClassLongPtrW :: GetClassLongW
  293. SetClassLongPtrW :: SetClassLongW
  294. GetWindowLongPtrW :: GetWindowLongW
  295. SetWindowLongPtrW :: SetWindowLongW
  296. }
  297. GET_SC_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> INT {
  298. return INT(wParam) & 0xFFF0
  299. }
  300. GET_WHEEL_DELTA_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> c_short {
  301. return cast(c_short)HIWORD(cast(DWORD)wParam)
  302. }
  303. GET_KEYSTATE_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> WORD {
  304. return LOWORD(cast(DWORD)wParam)
  305. }
  306. GET_NCHITTEST_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> c_short {
  307. return cast(c_short)LOWORD(cast(DWORD)wParam)
  308. }
  309. GET_XBUTTON_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> WORD {
  310. return HIWORD(cast(DWORD)wParam)
  311. }
  312. // Retrieves the input code from wParam in WM_INPUT message.
  313. GET_RAWINPUT_CODE_WPARAM :: #force_inline proc "contextless" (wParam: WPARAM) -> RAWINPUT_CODE {
  314. return RAWINPUT_CODE(wParam & 0xFF)
  315. }
  316. MAKEINTRESOURCEW :: #force_inline proc "contextless" (#any_int i: int) -> LPWSTR {
  317. return cast(LPWSTR)uintptr(WORD(i))
  318. }
  319. Monitor_From_Flags :: enum DWORD {
  320. MONITOR_DEFAULTTONULL = 0x00000000, // Returns NULL
  321. MONITOR_DEFAULTTOPRIMARY = 0x00000001, // Returns a handle to the primary display monitor
  322. MONITOR_DEFAULTTONEAREST = 0x00000002, // Returns a handle to the display monitor that is nearest to the window
  323. }
  324. Monitor_Enum_Proc :: #type proc "system" (HMONITOR, HDC, LPRECT, LPARAM) -> BOOL
  325. Window_Enum_Proc :: #type proc "system" (HWND, LPARAM) -> BOOL
  326. USER_DEFAULT_SCREEN_DPI :: 96
  327. DPI_AWARENESS_CONTEXT :: distinct HANDLE
  328. DPI_AWARENESS_CONTEXT_UNAWARE :: DPI_AWARENESS_CONTEXT(~uintptr(0)) // -1
  329. DPI_AWARENESS_CONTEXT_SYSTEM_AWARE :: DPI_AWARENESS_CONTEXT(~uintptr(1)) // -2
  330. DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE :: DPI_AWARENESS_CONTEXT(~uintptr(2)) // -3
  331. DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 :: DPI_AWARENESS_CONTEXT(~uintptr(3)) // -4
  332. DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED :: DPI_AWARENESS_CONTEXT(~uintptr(4)) // -5
  333. RAWINPUT_CODE :: enum {
  334. // The input is in the regular message flow,
  335. // the app is required to call DefWindowProc
  336. // so that the system can perform clean ups.
  337. RIM_INPUT = 0,
  338. // The input is sink only. The app is expected
  339. // to behave nicely.
  340. RIM_INPUTSINK = 1,
  341. }
  342. RAWINPUTHEADER :: struct {
  343. dwType: DWORD,
  344. dwSize: DWORD,
  345. hDevice: HANDLE,
  346. wParam: WPARAM,
  347. }
  348. RAWHID :: struct {
  349. dwSizeHid: DWORD,
  350. dwCount: DWORD,
  351. bRawData: [1]BYTE,
  352. }
  353. RAWMOUSE :: struct {
  354. usFlags: USHORT,
  355. using DUMMYUNIONNAME: struct #raw_union {
  356. ulButtons: ULONG,
  357. using DUMMYSTRUCTNAME: struct {
  358. usButtonFlags: USHORT,
  359. usButtonData: USHORT,
  360. },
  361. },
  362. ulRawButtons: ULONG,
  363. lLastX: LONG,
  364. lLastY: LONG,
  365. ulExtraInformation: ULONG,
  366. }
  367. RAWKEYBOARD :: struct {
  368. MakeCode: USHORT,
  369. Flags: USHORT,
  370. Rserved: USHORT,
  371. VKey: USHORT,
  372. Message: UINT,
  373. ExtraInformation: ULONG,
  374. }
  375. RAWINPUT :: struct {
  376. header: RAWINPUTHEADER,
  377. data: struct #raw_union {
  378. mouse: RAWMOUSE,
  379. keyboard: RAWKEYBOARD,
  380. hid: RAWHID,
  381. },
  382. }
  383. PRAWINPUT :: ^RAWINPUT
  384. HRAWINPUT :: distinct LPARAM
  385. RAWINPUTDEVICE :: struct {
  386. usUsagePage: USHORT,
  387. usUsage: USHORT,
  388. dwFlags: DWORD,
  389. hwndTarget: HWND,
  390. }
  391. PRAWINPUTDEVICE :: ^RAWINPUTDEVICE
  392. PCRAWINPUTDEVICE :: PRAWINPUTDEVICE
  393. RAWINPUTDEVICELIST :: struct {
  394. hDevice: HANDLE,
  395. dwType: DWORD,
  396. }
  397. PRAWINPUTDEVICELIST :: ^RAWINPUTDEVICELIST
  398. RID_DEVICE_INFO_HID :: struct {
  399. dwVendorId: DWORD,
  400. dwProductId: DWORD,
  401. dwVersionNumber: DWORD,
  402. usUsagePage: USHORT,
  403. usUsage: USHORT,
  404. }
  405. RID_DEVICE_INFO_KEYBOARD :: struct {
  406. dwType: DWORD,
  407. dwSubType: DWORD,
  408. dwKeyboardMode: DWORD,
  409. dwNumberOfFunctionKeys: DWORD,
  410. dwNumberOfIndicators: DWORD,
  411. dwNumberOfKeysTotal: DWORD,
  412. }
  413. RID_DEVICE_INFO_MOUSE :: struct {
  414. dwId: DWORD,
  415. dwNumberOfButtons: DWORD,
  416. dwSampleRate: DWORD,
  417. fHasHorizontalWheel: BOOL,
  418. }
  419. RID_DEVICE_INFO :: struct {
  420. cbSize: DWORD,
  421. dwType: DWORD,
  422. using DUMMYUNIONNAME: struct #raw_union {
  423. mouse: RID_DEVICE_INFO_MOUSE,
  424. keyboard: RID_DEVICE_INFO_KEYBOARD,
  425. hid: RID_DEVICE_INFO_HID,
  426. },
  427. }
  428. RIDEV_REMOVE :: 0x00000001
  429. RIDEV_EXCLUDE :: 0x00000010
  430. RIDEV_PAGEONLY :: 0x00000020
  431. RIDEV_NOLEGACY :: 0x00000030
  432. RIDEV_INPUTSINK :: 0x00000100
  433. RIDEV_CAPTUREMOUSE :: 0x00000200
  434. RIDEV_NOHOTKEYS :: 0x00000200
  435. RIDEV_APPKEYS :: 0x00000400
  436. RIDEV_EXINPUTSINK :: 0x00001000
  437. RIDEV_DEVNOTIFY :: 0x00002000
  438. RID_HEADER :: 0x10000005
  439. RID_INPUT :: 0x10000003
  440. RIDI_PREPARSEDDATA :: 0x20000005
  441. RIDI_DEVICENAME :: 0x20000007
  442. RIDI_DEVICEINFO :: 0x2000000b
  443. RIM_TYPEMOUSE :: 0
  444. RIM_TYPEKEYBOARD :: 1
  445. RIM_TYPEHID :: 2
  446. RI_KEY_MAKE :: 0
  447. RI_KEY_BREAK :: 1
  448. RI_KEY_E0 :: 2
  449. RI_KEY_E1 :: 4
  450. RI_KEY_TERMSRV_SET_LED :: 8
  451. RI_KEY_TERMSRV_SHADOW :: 0x10
  452. MOUSE_MOVE_RELATIVE :: 0x00
  453. MOUSE_MOVE_ABSOLUTE :: 0x01
  454. MOUSE_VIRTUAL_DESKTOP :: 0x02
  455. MOUSE_ATTRIUBTTES_CHANGED :: 0x04
  456. MOUSE_MOVE_NOCOALESCE :: 0x08
  457. RI_MOUSE_BUTTON_1_DOWN :: 0x0001
  458. RI_MOUSE_LEFT_BUTTON_DOWNS :: RI_MOUSE_BUTTON_1_DOWN
  459. RI_MOUSE_BUTTON_1_UP :: 0x0002
  460. RI_MOUSE_LEFT_BUTTON_UP :: RI_MOUSE_BUTTON_1_UP
  461. RI_MOUSE_BUTTON_2_DOWN :: 0x0004
  462. RI_MOUSE_RIGHT_BUTTON_DOWN :: RI_MOUSE_BUTTON_2_DOWN
  463. RI_MOUSE_BUTTON_2_UP :: 0x0008
  464. RI_MOUSE_RIGHT_BUTTON_UP :: RI_MOUSE_BUTTON_2_UP
  465. RI_MOUSE_BUTTON_3_DOWN :: 0x0010
  466. RI_MOUSE_MIDDLE_BUTTON_DOWN :: RI_MOUSE_BUTTON_3_DOWN
  467. RI_MOUSE_BUTTON_3_UP :: 0x0020
  468. RI_MOUSE_MIDDLE_BUTTON_UP :: RI_MOUSE_BUTTON_3_UP
  469. RI_MOUSE_BUTTON_4_DOWN :: 0x0040
  470. RI_MOUSE_BUTTON_4_UP :: 0x0080
  471. RI_MOUSE_BUTTON_5_DOWN :: 0x0100
  472. RI_MOUSE_BUTTON_5_UP :: 0x0200
  473. RI_MOUSE_WHEEL :: 0x0400
  474. RI_MOUSE_HWHEEL :: 0x0800
  475. WINDOWPLACEMENT :: struct {
  476. length: UINT,
  477. flags: UINT,
  478. showCmd: UINT,
  479. ptMinPosition: POINT,
  480. ptMaxPosition: POINT,
  481. rcNormalPosition: RECT,
  482. }
  483. WINDOWINFO :: struct {
  484. cbSize: DWORD,
  485. rcWindow: RECT,
  486. rcClient: RECT,
  487. dwStyle: DWORD,
  488. dwExStyle: DWORD,
  489. dwWindowStatus: DWORD,
  490. cxWindowBorders: UINT,
  491. cyWindowBorders: UINT,
  492. atomWindowType: ATOM,
  493. wCreatorVersion: WORD,
  494. }
  495. PWINDOWINFO :: ^WINDOWINFO
  496. CURSORINFO :: struct {
  497. cbSize: DWORD,
  498. flags: DWORD,
  499. hCursor: HCURSOR,
  500. ptScreenPos: POINT,
  501. }
  502. PCURSORINFO :: ^CURSORINFO
  503. DRAWTEXTPARAMS :: struct {
  504. cbSize: UINT,
  505. iTabLength: INT,
  506. iLeftMargin: INT,
  507. iRightMargin: INT,
  508. uiLengthDrawn: UINT,
  509. }
  510. PDRAWTEXTPARAMS :: ^DRAWTEXTPARAMS
  511. DrawTextFormat :: enum UINT {
  512. DT_TOP = 0x00000000,
  513. DT_LEFT = 0x00000000,
  514. DT_CENTER = 0x00000001,
  515. DT_RIGHT = 0x00000002,
  516. DT_VCENTER = 0x00000004,
  517. DT_BOTTOM = 0x00000008,
  518. DT_WORDBREAK = 0x00000010,
  519. DT_SINGLELINE = 0x00000020,
  520. DT_EXPANDTABS = 0x00000040,
  521. DT_TABSTOP = 0x00000080,
  522. DT_NOCLIP = 0x00000100,
  523. DT_EXTERNALLEADING = 0x00000200,
  524. DT_CALCRECT = 0x00000400,
  525. DT_NOPREFIX = 0x00000800,
  526. DT_INTERNAL = 0x00001000,
  527. DT_EDITCONTROL = 0x00002000,
  528. DT_PATH_ELLIPSIS = 0x00004000,
  529. DT_END_ELLIPSIS = 0x00008000,
  530. DT_MODIFYSTRING = 0x00010000,
  531. DT_RTLREADING = 0x00020000,
  532. DT_WORD_ELLIPSIS = 0x00040000,
  533. DT_NOFULLWIDTHCHARBREAK = 0x00080000,
  534. DT_HIDEPREFIX = 0x00100000,
  535. DT_PREFIXONLY = 0x00200000,
  536. }
  537. RedrawWindowFlags :: enum UINT {
  538. RDW_INVALIDATE = 0x0001,
  539. RDW_INTERNALPAINT = 0x0002,
  540. RDW_ERASE = 0x0004,
  541. RDW_VALIDATE = 0x0008,
  542. RDW_NOINTERNALPAINT = 0x0010,
  543. RDW_NOERASE = 0x0020,
  544. RDW_NOCHILDREN = 0x0040,
  545. RDW_ALLCHILDREN = 0x0080,
  546. RDW_UPDATENOW = 0x0100,
  547. RDW_ERASENOW = 0x0200,
  548. RDW_FRAME = 0x0400,
  549. RDW_NOFRAME = 0x0800,
  550. }
  551. GetUserObjectInformationFlags :: enum INT {
  552. UOI_FLAGS = 1,
  553. UOI_NAME = 2,
  554. UOI_TYPE = 3,
  555. UOI_USER_SID = 4,
  556. UOI_HEAPSIZE = 5,
  557. UOI_IO = 6,
  558. UOI_TIMERPROC_EXCEPTION_SUPPRESSION = 7,
  559. }
  560. USEROBJECTFLAGS :: struct {
  561. fInherit: BOOL,
  562. fReserved: BOOL,
  563. dwFlags: DWORD,
  564. }
  565. PROPENUMPROCW :: #type proc(unnamedParam1: HWND, unnamedParam2: LPCWSTR, unnamedParam3: HANDLE) -> BOOL
  566. PROPENUMPROCEXW :: #type proc(unnamedParam1: HWND, unnamedParam2: LPCWSTR, unnamedParam3: HANDLE, unnamedParam4: ULONG_PTR) -> BOOL
  567. RT_CURSOR :: LPWSTR(uintptr(0x00000001))
  568. RT_BITMAP :: LPWSTR(uintptr(0x00000002))
  569. RT_ICON :: LPWSTR(uintptr(0x00000003))
  570. RT_MENU :: LPWSTR(uintptr(0x00000004))
  571. RT_DIALOG :: LPWSTR(uintptr(0x00000005))
  572. RT_STRING :: LPWSTR(uintptr(0x00000006))
  573. RT_FONTDIR :: LPWSTR(uintptr(0x00000007))
  574. RT_FONT :: LPWSTR(uintptr(0x00000008))
  575. RT_ACCELERATOR :: LPWSTR(uintptr(0x00000009))
  576. RT_RCDATA :: LPWSTR(uintptr(0x0000000A))
  577. RT_MESSAGETABLE :: LPWSTR(uintptr(0x0000000B))
  578. RT_GROUP_CURSOR :: LPWSTR(uintptr(0x0000000C))
  579. RT_GROUP_ICON :: LPWSTR(uintptr(0x0000000E))
  580. RT_VERSION :: LPWSTR(uintptr(0x00000010))
  581. RT_DLGINCLUDE :: LPWSTR(uintptr(0x00000011))
  582. RT_PLUGPLAY :: LPWSTR(uintptr(0x00000013))
  583. RT_VXD :: LPWSTR(uintptr(0x00000014))
  584. RT_ANICURSOR :: LPWSTR(uintptr(0x00000015))
  585. RT_ANIICON :: LPWSTR(uintptr(0x00000016))
  586. RT_MANIFEST :: LPWSTR(uintptr(0x00000018))
  587. CREATEPROCESS_MANIFEST_RESOURCE_ID :: LPWSTR(uintptr(0x00000001))
  588. ISOLATIONAWARE_MANIFEST_RESOURCE_ID :: LPWSTR(uintptr(0x00000002))
  589. ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID :: LPWSTR(uintptr(0x00000003))
  590. ISOLATIONPOLICY_MANIFEST_RESOURCE_ID :: LPWSTR(uintptr(0x00000004))
  591. ISOLATIONPOLICY_BROWSER_MANIFEST_RESOURCE_ID :: LPWSTR(uintptr(0x00000005))
  592. MINIMUM_RESERVED_MANIFEST_RESOURCE_ID :: LPWSTR(uintptr(0x00000001))
  593. MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID :: LPWSTR(uintptr(0x00000010))
  594. ACCEL :: struct {
  595. /* Also called the flags field */
  596. fVirt: BYTE,
  597. key: WORD,
  598. cmd: WORD,
  599. }
  600. LPACCEL :: ^ACCEL
  601. MIIM_STATE :: 0x00000001
  602. MIIM_ID :: 0x00000002
  603. MIIM_SUBMENU :: 0x00000004
  604. MIIM_CHECKMARKS :: 0x00000008
  605. MIIM_TYPE :: 0x00000010
  606. MIIM_DATA :: 0x00000020
  607. MIIM_STRING :: 0x00000040
  608. MIIM_BITMAP :: 0x00000080
  609. MIIM_FTYPE :: 0x00000100
  610. MENUITEMINFOW :: struct {
  611. cbSize: UINT,
  612. fMask: UINT,
  613. fType: UINT, // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
  614. fState: UINT, // used if MIIM_STATE
  615. wID: UINT, // used if MIIM_ID
  616. hSubMenu: HMENU, // used if MIIM_SUBMENU
  617. hbmpChecked: HBITMAP, // used if MIIM_CHECKMARKS
  618. hbmpUnchecked: HBITMAP, // used if MIIM_CHECKMARKS
  619. dwItemData: ULONG_PTR, // used if MIIM_DATA
  620. dwTypeData: LPWSTR, // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  621. cch: UINT, // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
  622. hbmpItem: HBITMAP, // used if MIIM_BITMAP
  623. }
  624. LPMENUITEMINFOW :: ^MENUITEMINFOW
  625. DISPLAY_DEVICEW :: struct {
  626. cb: DWORD,
  627. DeviceName: [32]WCHAR,
  628. DeviceString: [128]WCHAR,
  629. StateFlags: DWORD,
  630. DeviceID: [128]WCHAR,
  631. DeviceKey: [128]WCHAR,
  632. }
  633. PDISPLAY_DEVICEW :: ^DISPLAY_DEVICEW
  634. // OUTOFCONTEXT is the zero value, use {}
  635. WinEventFlags :: bit_set[WinEventFlag; DWORD]
  636. WinEventFlag :: enum DWORD {
  637. SKIPOWNTHREAD = 0,
  638. SKIPOWNPROCESS = 1,
  639. INCONTEXT = 2,
  640. }
  641. // Standard Clipboard Formats
  642. CF_TEXT :: 1
  643. CF_BITMAP :: 2
  644. CF_METAFILEPICT :: 3
  645. CF_SYLK :: 4
  646. CF_DIF :: 5
  647. CF_TIFF :: 6
  648. CF_OEMTEXT :: 7
  649. CF_DIB :: 8
  650. CF_PALETTE :: 9
  651. CF_PENDATA :: 10
  652. CF_RIFF :: 11
  653. CF_WAVE :: 12
  654. CF_UNICODETEXT :: 13
  655. CF_ENHMETAFILE :: 14
  656. CF_HDROP :: 15
  657. CF_LOCALE :: 16
  658. CF_DIBV5 :: 17
  659. CF_DSPBITMAP :: 0x0082
  660. CF_DSPENHMETAFILE :: 0x008E
  661. CF_DSPMETAFILEPICT :: 0x0083
  662. CF_DSPTEXT :: 0x0081
  663. CF_GDIOBJFIRST :: 0x0300
  664. CF_GDIOBJLAST :: 0x03FF
  665. CF_OWNERDISPLAY :: 0x0080
  666. CF_PRIVATEFIRST :: 0x0200
  667. CF_PRIVATELAST :: 0x02FF
  668. STICKYKEYS :: struct {
  669. cbSize: UINT,
  670. dwFlags: DWORD,
  671. }
  672. LPSTICKYKEYS :: ^STICKYKEYS
  673. SKF_STICKYKEYSON :: 0x1
  674. SKF_AVAILABLE :: 0x2
  675. SKF_HOTKEYACTIVE :: 0x4
  676. SKF_CONFIRMHOTKEY :: 0x8
  677. SKF_HOTKEYSOUND :: 0x10
  678. SKF_INDICATOR :: 0x20
  679. SKF_AUDIBLEFEEDBACK :: 0x40
  680. SKF_TRISTATE :: 0x80
  681. SKF_TWOKEYSOFF :: 0x100
  682. SKF_LSHIFTLOCKED :: 0x10000
  683. SKF_RSHIFTLOCKED :: 0x20000
  684. SKF_LCTLLOCKED :: 0x40000
  685. SKF_RCTLLOCKED :: 0x80000
  686. SKF_LALTLOCKED :: 0x100000
  687. SKF_RALTLOCKED :: 0x200000
  688. SKF_LWINLOCKED :: 0x400000
  689. SKF_RWINLOCKED :: 0x800000
  690. SKF_LSHIFTLATCHED :: 0x1000000
  691. SKF_RSHIFTLATCHED :: 0x2000000
  692. SKF_LCTLLATCHED :: 0x4000000
  693. SKF_RCTLLATCHED :: 0x8000000
  694. SKF_LALTLATCHED :: 0x10000000
  695. SKF_RALTLATCHED :: 0x20000000
  696. TOGGLEKEYS :: struct {
  697. cbSize: UINT,
  698. dwFlags: DWORD,
  699. }
  700. LPTOGGLEKEYS :: ^TOGGLEKEYS
  701. TKF_TOGGLEKEYSON :: 0x1
  702. TKF_AVAILABLE :: 0x2
  703. TKF_HOTKEYACTIVE :: 0x4
  704. TKF_CONFIRMHOTKEY :: 0x8
  705. TKF_HOTKEYSOUND :: 0x10
  706. TKF_INDICATOR :: 0x20
  707. FILTERKEYS :: struct {
  708. cbSize: UINT,
  709. dwFlags: DWORD,
  710. iWaitMSec: DWORD,
  711. iDelayMSec: DWORD,
  712. iRepeatMSec: DWORD,
  713. iBounceMSec: DWORD,
  714. }
  715. LPFILTERKEYS :: ^FILTERKEYS
  716. FKF_FILTERKEYSON :: 0x1
  717. FKF_AVAILABLE :: 0x2
  718. FKF_HOTKEYACTIVE :: 0x4
  719. FKF_CONFIRMHOTKEY :: 0x8
  720. FKF_HOTKEYSOUND :: 0x10
  721. FKF_INDICATOR :: 0x20
  722. FKF_CLICKON :: 0x40