shell32.odin 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // +build windows
  2. package sys_windows
  3. foreign import shell32 "system:Shell32.lib"
  4. @(default_calling_convention="stdcall")
  5. foreign shell32 {
  6. CommandLineToArgvW :: proc(cmd_list: wstring, num_args: ^c_int) -> ^wstring ---
  7. ShellExecuteW :: proc(
  8. hwnd: HWND,
  9. lpOperation: LPCWSTR,
  10. lpFile: LPCWSTR,
  11. lpParameters: LPCWSTR,
  12. lpDirectory: LPCWSTR,
  13. nShowCmd: INT,
  14. ) -> HINSTANCE ---
  15. ShellExecuteExW :: proc(pExecInfo: ^SHELLEXECUTEINFOW) -> BOOL ---
  16. SHCreateDirectoryExW :: proc(
  17. hwnd: HWND,
  18. pszPath: LPCWSTR,
  19. psa: ^SECURITY_ATTRIBUTES,
  20. ) -> c_int ---
  21. SHFileOperationW :: proc(lpFileOp: LPSHFILEOPSTRUCTW) -> c_int ---
  22. SHGetFolderPathW :: proc(hwnd: HWND, csidl: c_int, hToken: HANDLE, dwFlags: DWORD, pszPath: LPWSTR) -> HRESULT ---
  23. SHAppBarMessage :: proc(dwMessage: DWORD, pData: PAPPBARDATA) -> UINT_PTR ---
  24. Shell_NotifyIconW :: proc(dwMessage: DWORD, lpData: ^NOTIFYICONDATAW) -> BOOL ---
  25. SHGetKnownFolderIDList :: proc(rfid: REFKNOWNFOLDERID, dwFlags: /* KNOWN_FOLDER_FLAG */ DWORD, hToken: HANDLE, ppidl: rawptr) -> HRESULT ---
  26. SHSetKnownFolderPath :: proc(rfid: REFKNOWNFOLDERID, dwFlags: /* KNOWN_FOLDER_FLAG */ DWORD, hToken: HANDLE, pszPath: PCWSTR ) -> HRESULT ---
  27. SHGetKnownFolderPath :: proc(rfid: REFKNOWNFOLDERID, dwFlags: /* KNOWN_FOLDER_FLAG */ DWORD, hToken: HANDLE, ppszPath: ^LPWSTR) -> HRESULT ---
  28. }
  29. APPBARDATA :: struct {
  30. cbSize: DWORD,
  31. hWnd: HWND,
  32. uCallbackMessage: UINT,
  33. uEdge: UINT,
  34. rc: RECT,
  35. lParam: LPARAM,
  36. }
  37. PAPPBARDATA :: ^APPBARDATA
  38. ABM_NEW :: 0x00000000
  39. ABM_REMOVE :: 0x00000001
  40. ABM_QUERYPOS :: 0x00000002
  41. ABM_SETPOS :: 0x00000003
  42. ABM_GETSTATE :: 0x00000004
  43. ABM_GETTASKBARPOS :: 0x00000005
  44. ABM_ACTIVATE :: 0x00000006
  45. ABM_GETAUTOHIDEBAR :: 0x00000007
  46. ABM_SETAUTOHIDEBAR :: 0x00000008
  47. ABM_WINDOWPOSCHANGED :: 0x0000009
  48. ABM_SETSTATE :: 0x0000000a
  49. ABN_STATECHANGE :: 0x0000000
  50. ABN_POSCHANGED :: 0x0000001
  51. ABN_FULLSCREENAPP :: 0x0000002
  52. ABN_WINDOWARRANGE :: 0x0000003
  53. ABS_AUTOHIDE :: 0x0000001
  54. ABS_ALWAYSONTOP :: 0x0000002
  55. ABE_LEFT :: 0
  56. ABE_TOP :: 1
  57. ABE_RIGHT :: 2
  58. ABE_BOTTOM :: 3
  59. KNOWNFOLDERID :: GUID
  60. REFKNOWNFOLDERID :: ^KNOWNFOLDERID
  61. KNOWN_FOLDER_FLAG :: enum u32 {
  62. DEFAULT = 0x00000000,
  63. // if NTDDI_VERSION >= NTDDI_WIN10_RS3
  64. FORCE_APP_DATA_REDIRECTION = 0x00080000,
  65. // if NTDDI_VERSION >= NTDDI_WIN10_RS2
  66. RETURN_FILTER_REDIRECTION_TARGET = 0x00040000,
  67. FORCE_PACKAGE_REDIRECTION = 0x00020000,
  68. NO_PACKAGE_REDIRECTION = 0x00010000,
  69. FORCE_APPCONTAINER_REDIRECTION = 0x00020000,
  70. // if NTDDI_VERSION >= NTDDI_WIN7
  71. NO_APPCONTAINER_REDIRECTION = 0x00010000,
  72. CREATE = 0x00008000,
  73. DONT_VERIFY = 0x00004000,
  74. DONT_UNEXPAND = 0x00002000,
  75. NO_ALIAS = 0x00001000,
  76. INIT = 0x00000800,
  77. DEFAULT_PATH = 0x00000400,
  78. NOT_PARENT_RELATIVE = 0x00000200,
  79. SIMPLE_IDLIST = 0x00000100,
  80. ALIAS_ONLY = 0x80000000,
  81. }