You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

332 lines
12 KiB

  1. using System;
  2. using System.IO;
  3. using System.Runtime.InteropServices;
  4. using System.Text;
  5. namespace Apewer.Internals.Interop
  6. {
  7. internal class Constant
  8. {
  9. /// <summary></summary>
  10. public const byte AC_SRC_OVER = 0;
  11. /// <summary></summary>
  12. public const byte AC_SRC_ALPHA = 1;
  13. /// <summary>从左到右显示。</summary>
  14. public const Int32 AW_HOR_POSITIVE = 0x00000001;
  15. /// <summary>从右到左显示。</summary>
  16. public const Int32 AW_HOR_NEGATIVE = 0x00000002;
  17. /// <summary>从上到下显示。</summary>
  18. public const Int32 AW_VER_POSITIVE = 0x00000004;
  19. /// <summary>从下到上显示。</summary>
  20. public const Int32 AW_VER_NEGATIVE = 0x00000008;
  21. /// <summary>若使用了AW_HIDE标志,则使窗口向内重叠,即收缩窗口;否则使窗口向外扩展,即展开窗口。</summary>
  22. public const Int32 AW_CENTER = 0x00000010;
  23. /// <summary>隐藏窗口,缺省则显示窗口。</summary>
  24. public const Int32 AW_HIDE = 0x00010000;
  25. /// <summary>激活窗口。在使用了AW_HIDE标志后不能使用这个标志。</summary>
  26. public const Int32 AW_ACTIVATE = 0x00020000;
  27. /// <summary>使用滑动类型。缺省则为滚动动画类型。当使用AW_CENTER标志时,这个标志就被忽略。</summary>
  28. public const Int32 AW_SLIDE = 0x00040000;
  29. /// <summary>透明度从高到低。</summary>
  30. public const Int32 AW_BLEND = 0x00080000;
  31. /// <summary></summary>
  32. public const int CS_DROPSHADOW = 0x20000;
  33. /// <summary></summary>
  34. public const int FILE_ATTRIBUTE_NORMAL = 0x80;
  35. /// <summary></summary>
  36. public const uint FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000;
  37. /// <summary></summary>
  38. public const int FILE_MAP_COPY = 1;
  39. /// <summary></summary>
  40. public const int FILE_MAP_WRITE = 2;
  41. /// <summary></summary>
  42. public const int FILE_MAP_READ = 4;
  43. /// <summary></summary>
  44. public const int GCL_STYLE = (-26);
  45. /// <summary></summary>
  46. public const uint GENERIC_READ = 0x80000000;
  47. /// <summary></summary>
  48. public const uint GENERIC_WRITE = 0x40000000;
  49. /// <summary></summary>
  50. public const int GWL_EXSTYLE = -20;
  51. public const uint GGI_MARK_NONEXISTING_GLYPHS = 0x01;
  52. /// <summary></summary>
  53. public const int INVALID_HANDLE_VALUE = -1;
  54. /// <summary></summary>
  55. public const int OPEN_EXISTING = 3;
  56. /// <summary></summary>
  57. public const uint PAGE_READWRITE = 0x04;
  58. /// <summary></summary>
  59. public const int PROCESS_ALL_ACCESS = 0x1F0FFF;
  60. /// <summary></summary>
  61. public const int PROCESS_QUERY_INFORMATION = 0x400;
  62. /// <summary></summary>
  63. public const int SC_MOVE = 0xF010;
  64. /// <summary>play synchronously (default)</summary>
  65. public const int SND_SYNC = 0x0000;
  66. /// <summary>play asynchronously</summary>
  67. public const int SND_ASYNC = 0x0001;
  68. /// <summary>silence (!default) if sound not found</summary>
  69. public const int SND_NODEFAULT = 0x0002;
  70. /// <summary>pszSound points to a memory file</summary>
  71. public const int SND_MEMORY = 0x0004;
  72. /// <summary>loop the sound until next sndPlaySound</summary>
  73. public const int SND_LOOP = 0x0008;
  74. /// <summary>don’t stop any currently playing sound</summary>
  75. public const int SND_NOSTOP = 0x0010;
  76. /// <summary>Stop Playing Wave</summary>
  77. public const int SND_PURGE = 0x0040;
  78. /// <summary>don’t wait if the driver is busy</summary>
  79. public const int SND_NOWAIT = 0x00002000;
  80. /// <summary>name is a registry alias</summary>
  81. public const int SND_ALIAS = 0x00010000;
  82. /// <summary>alias is a predefined id</summary>
  83. public const int SND_ALIAS_ID = 0x00110000;
  84. /// <summary>name is file name</summary>
  85. public const int SND_FILENAME = 0x00020000;
  86. /// <summary>name is resource name or atom</summary>
  87. public const int SND_RESOURCE = 0x00040004;
  88. /// <summary></summary>
  89. public const int STILL_ALIVE = 0x103;
  90. /// <summary></summary>
  91. public const int SW_HIDE = 0;
  92. /// <summary></summary>
  93. public const int SW_SHOWNORMAL = 1;
  94. /// <summary></summary>
  95. public const int SW_SHOWMINIMIZED = 2;
  96. /// <summary></summary>
  97. public const int SW_SHOWMAXIMIZED = 3;
  98. /// <summary></summary>
  99. public const int SW_MAXIMIZE = 3;
  100. /// <summary></summary>
  101. public const int SW_SHOWNOACTIVATE = 4;
  102. /// <summary></summary>
  103. public const int SW_SHOW = 5;
  104. /// <summary></summary>
  105. public const int SW_MINIMIZE = 6;
  106. /// <summary></summary>
  107. public const int SW_SHOWMINNOACTIVE = 7;
  108. /// <summary></summary>
  109. public const int SW_SHOWNA = 8;
  110. /// <summary></summary>
  111. public const int SW_RESTORE = 9;
  112. /// <summary></summary>
  113. public const int ULW_ALPHA = 2;
  114. /// <summary></summary>
  115. public const int WM_CLOSE = 0x0010;
  116. /// <summary></summary>
  117. public const int WM_KEYDOWN = 0X100;
  118. /// <summary></summary>
  119. public const int WM_KEYUP = 0X101;
  120. /// <summary></summary>
  121. public const int WM_SYSCHAR = 0X106;
  122. /// <summary></summary>
  123. public const int WM_SYSKEYUP = 0X105;
  124. /// <summary></summary>
  125. public const int WM_SYSKEYDOWN = 0X104;
  126. /// <summary></summary>
  127. public const int WM_CHAR = 0X102;
  128. /// <summary></summary>
  129. public const int WS_EX_TRANSPARENT = 0x00000020;
  130. /// <summary></summary>
  131. public const int WS_EX_LAYERED = 0x00080000;
  132. /// <summary></summary>
  133. public const int WS_SYSMENU = 0x00080000;
  134. /// <summary></summary>
  135. public const int WS_MINIMIZEBOX = 0x00020000;
  136. public const int ENUM_CURRENT_SETTINGS = -1;
  137. public const int CDS_UPDATEREGISTRY = 0x01;
  138. public const int CDS_TEST = 0x02;
  139. public const int DISP_CHANGE_SUCCESSFUL = 0;
  140. public const int DISP_CHANGE_RESTART = 1;
  141. public const int DISP_CHANGE_FAILED = -1;
  142. public const int DISP_CHANGE_BADMODE = -2;
  143. public const int DISP_CHANGE_NOTUPDATED = -3;
  144. public const int DISP_CHANGE_BADFLAGS = -4;
  145. public const int DISP_CHANGE_BADPARAM = -5;
  146. public const int DISP_CHANGE_BADDUALVIEW = -6;
  147. public const int DMDO_DEFAULT = 0;
  148. public const int DMDO_90 = 1;
  149. public const int DMDO_180 = 2;
  150. public const int DMDO_270 = 3;
  151. public const int SE_PRIVILEGE_ENABLED = 0x00000002;
  152. public const int TOKEN_QUERY = 0x00000008;
  153. public const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
  154. public const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
  155. public const int EWX_LOGOFF = 0x00000000;
  156. public const int EWX_SHUTDOWN = 0x00000001;
  157. public const int EWX_REBOOT = 0x00000002;
  158. public const int EWX_FORCE = 0x00000004;
  159. public const int EWX_POWEROFF = 0x00000008;
  160. public const int EWX_FORCEIFHUNG = 0x00000010;
  161. #region Windows Hook
  162. /// <summary>
  163. /// Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar.
  164. /// For more information, see the MessageProc hook procedure.
  165. /// </summary>
  166. public const int WH_MSGFILTER = -1;
  167. /// <summary>
  168. /// Installs a hook procedure that records input messages posted to the system message queue.
  169. /// This hook is useful for recording macros.
  170. /// For more information, see the JournalRecordProc hook procedure.
  171. /// </summary>
  172. public const int WH_JOURNALRECORD = 0;
  173. /// <summary>
  174. /// Installs a hook procedure that posts messages previously recorded by a WH_JOURNALRECORD hook procedure.
  175. /// For more information, see the JournalPlaybackProc hook procedure.
  176. /// </summary>
  177. public const int WH_JOURNALPLAYBACK = 1;
  178. /// <summary>
  179. /// Installs a hook procedure that monitors keystroke messages.
  180. /// For more information, see the KeyboardProc hook procedure.
  181. /// </summary>
  182. public const int WH_KEYBOARD = 2;
  183. /// <summary>
  184. /// Installs a hook procedure that monitors messages posted to a message queue.
  185. /// For more information, see the GetMsgProc hook procedure.
  186. /// </summary>
  187. public const int WH_GETMESSAGE = 3;
  188. /// <summary>
  189. /// Installs a hook procedure that monitors messages before the system sends them to the destination window procedure.
  190. /// For more information, see the CallWndProc hook procedure.
  191. /// </summary>
  192. public const int WH_CALLWNDPROC = 4;
  193. /// <summary>
  194. /// Installs a hook procedure that receives notifications useful to a CBT application.
  195. /// For more information, see the CBTProc hook procedure.
  196. /// </summary>
  197. public const int WH_CBT = 5;
  198. /// <summary>
  199. /// Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar.
  200. /// The hook procedure monitors these messages for all applications in the same desktop as the calling thread.
  201. /// For more information, see the SysMsgProc hook procedure.
  202. /// </summary>
  203. public const int WH_SYSMSGFILTER = 6;
  204. /// <summary>
  205. /// Installs a hook procedure that monitors mouse messages.
  206. /// For more information, see the MouseProc hook procedure.
  207. /// </summary>
  208. public const int WH_MOUSE = 7;
  209. /// <summary>
  210. /// Installs a hook procedure useful for debugging other hook procedures.
  211. /// For more information, see the DebugProc hook procedure.
  212. /// </summary>
  213. public const int WH_DEBUG = 9;
  214. /// <summary>
  215. /// Installs a hook procedure that receives notifications useful to shell applications.
  216. /// For more information, see the ShellProc hook procedure.
  217. /// </summary>
  218. public const int WH_SHELL = 10;
  219. /// <summary>
  220. /// Installs a hook procedure that will be called when the application's foreground thread is about to become idle.
  221. /// This hook is useful for performing low priority tasks during idle time.
  222. /// For more information, see the ForegroundIdleProc hook procedure.
  223. /// </summary>
  224. public const int WH_FOREGROUNDIDLE = 11;
  225. /// <summary>
  226. /// Installs a hook procedure that monitors messages after they have been processed by the destination window procedure.
  227. /// For more information, see the CallWndRetProc hook procedure.
  228. /// </summary>
  229. public const int WH_CALLWNDPROCRET = 12;
  230. /// <summary>
  231. /// Installs a hook procedure that monitors low-level keyboard input events.
  232. /// For more information, see the LowLevelKeyboardProc hook procedure.
  233. /// </summary>
  234. public const int WH_KEYBOARD_LL = 13;
  235. /// <summary
  236. /// >Installs a hook procedure that monitors low-level mouse input events.
  237. /// For more information, see the LowLevelMouseProc hook procedure.
  238. /// </summary>
  239. public const int WH_MOUSE_LL = 14;
  240. #endregion
  241. }
  242. }