WindowMessages.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. //#########################################################################################
  2. //★★★★★★★ http://www.cnpopsoft.com [华普软件] ★★★★★★★
  3. //★★★★★★★ 华普软件 - VB & C#.NET 专业论文与源码荟萃! ★★★★★★★
  4. //#########################################################################################
  5. /*
  6. * Copyright ?2005, Mathew Hall
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification,
  10. * are permitted provided that the following conditions are met:
  11. *
  12. * - Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. *
  15. * - Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  22. * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  23. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  24. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  25. * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  26. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  28. * OF SUCH DAMAGE.
  29. */
  30. using System;
  31. namespace XPTable.Win32
  32. {
  33. /// <summary>
  34. /// The WindowMessage enemeration contains Windows messages that the
  35. /// XPTable may be interested in listening for
  36. /// </summary>
  37. public enum WindowMessage
  38. {
  39. /// <summary>
  40. /// The WM_ACTIVATE message is sent to both the window being activated and the
  41. /// window being deactivated. If the windows use the same input queue, the message
  42. /// is sent synchronously, first to the window procedure of the top-level window
  43. /// being deactivated, then to the window procedure of the top-level window being
  44. /// activated. If the windows use different input queues, the message is sent
  45. /// asynchronously, so the window is activated immediately
  46. /// </summary>
  47. WM_ACTIVATE = 0x0006,
  48. /// <summary>
  49. /// The WM_PAINT message is sent when the system or another application makes a request
  50. /// to paint a portion of an application's window. The message is sent when the
  51. /// UpdateWindow or RedrawWindow function is called, or by the DispatchMessage
  52. /// function when the application obtains a WM_PAINT message by using the GetMessage
  53. /// or PeekMessage function. A window receives this message through its WindowProc
  54. /// function
  55. /// </summary>
  56. WM_PAINT = 0x000F,
  57. /// <summary>
  58. /// The WM_CLOSE message is sent as a signal that a window or an application
  59. /// should terminate
  60. /// </summary>
  61. WM_CLOSE = 0x0010,
  62. /// <summary>
  63. /// The WM_ACTIVATEAPP message is sent when a window belonging to a different
  64. /// application than the active window is about to be activated. The message is
  65. /// sent to the application whose window is being activated and to the application
  66. /// whose window is being deactivated
  67. /// </summary>
  68. WM_ACTIVATEAPP = 0x001C,
  69. /// <summary>
  70. /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window
  71. /// and the user presses a mouse button. The parent window receives this message
  72. /// only if the child window passes it to the DefWindowProc function
  73. /// </summary>
  74. WM_MOUSEACTIVATE = 0x0021,
  75. /// <summary>
  76. /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to
  77. /// be changed to indicate an active or inactive state
  78. /// </summary>
  79. WM_NCACTIVATE = 0x0086,
  80. /// <summary>
  81. /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved
  82. /// within the nonclient area of the window. This message is posted to the window
  83. /// that contains the cursor. If a window has captured the mouse, this message
  84. /// is not posted
  85. /// </summary>
  86. WM_NCMOUSEMOVE = 0x00A0,
  87. /// <summary>
  88. /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse
  89. /// button while the cursor is within the nonclient area of a window. This message
  90. /// is posted to the window that contains the cursor. If a window has captured
  91. /// the mouse, this message is not posted
  92. /// </summary>
  93. WM_NCLBUTTONDOWN = 0x00A1,
  94. /// <summary>
  95. /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse
  96. /// button while the cursor is within the nonclient area of a window. This message
  97. /// is posted to the window that contains the cursor. If a window has captured
  98. /// the mouse, this message is not posted
  99. /// </summary>
  100. WM_NCLBUTTONUP = 0x00A2,
  101. /// <summary>
  102. /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the
  103. /// left mouse button while the cursor is within the nonclient area of a window.
  104. /// This message is posted to the window that contains the cursor. If a window
  105. /// has captured the mouse, this message is not posted
  106. /// </summary>
  107. WM_NCLBUTTONDBLCLK = 0x00A3,
  108. /// <summary>
  109. /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse
  110. /// button while the cursor is within the nonclient area of a window. This message
  111. /// is posted to the window that contains the cursor. If a window has captured
  112. /// the mouse, this message is not posted
  113. /// </summary>
  114. WM_NCRBUTTONDOWN = 0x00A4,
  115. /// <summary>
  116. /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse
  117. /// button while the cursor is within the nonclient area of a window. This message
  118. /// is posted to the window that contains the cursor. If a window has captured
  119. /// the mouse, this message is not posted
  120. /// </summary>
  121. WM_NCRBUTTONUP = 0x00A5,
  122. /// <summary>
  123. /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right
  124. /// mouse button while the cursor is within the nonclient area of a window. This
  125. /// message is posted to the window that contains the cursor. If a window has
  126. /// captured the mouse, this message is not posted
  127. /// </summary>
  128. WM_NCRBUTTONDBLCLK = 0x00A6,
  129. /// <summary>
  130. /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse
  131. /// button while the cursor is within the nonclient area of a window. This message
  132. /// is posted to the window that contains the cursor. If a window has captured the
  133. /// mouse, this message is not posted
  134. /// </summary>
  135. WM_NCMBUTTONDOWN = 0x00A7,
  136. /// <summary>
  137. /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse
  138. /// button while the cursor is within the nonclient area of a window. This message
  139. /// is posted to the window that contains the cursor. If a window has captured the
  140. /// mouse, this message is not posted
  141. /// </summary>
  142. WM_NCMBUTTONUP = 0x00A8,
  143. /// <summary>
  144. /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle
  145. /// mouse button while the cursor is within the nonclient area of a window. This
  146. /// message is posted to the window that contains the cursor. If a window has
  147. /// captured the mouse, this message is not posted
  148. /// </summary>
  149. WM_NCMBUTTONDBLCLK = 0x00A9,
  150. /// <summary>
  151. /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X
  152. /// button while the cursor is in the nonclient area of a window. This message is posted
  153. /// to the window that contains the cursor. If a window has captured the mouse, this
  154. /// message is not posted
  155. /// </summary>
  156. WM_NCXBUTTONDOWN = 0x00AB,
  157. /// <summary>
  158. /// The WM_NCXBUTTONUP message is posted when the user releases the first or second
  159. /// X button while the cursor is in the nonclient area of a window. This message is
  160. /// posted to the window that contains the cursor. If a window has captured the mouse,
  161. /// this message is not posted
  162. /// </summary>
  163. WM_NCXBUTTONUP = 0x00AC,
  164. /// <summary>
  165. /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or
  166. /// second X button while the cursor is in the nonclient area of a window. This message
  167. /// is posted to the window that contains the cursor. If a window has captured the mouse,
  168. /// this message is not posted
  169. /// </summary>
  170. WM_NCXBUTTONDBLCLK = 0x00AD,
  171. /// <summary>
  172. /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a
  173. /// nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT
  174. /// key is not pressed
  175. /// </summary>
  176. WM_KEYDOWN = 0x0100,
  177. /// <summary>
  178. /// The WM_KEYUP message is posted to the window with the keyboard focus when a
  179. /// nonsystem key is released. A nonsystem key is a key that is pressed when the ALT
  180. /// key is not pressed, or a keyboard key that is pressed when a window has the
  181. /// keyboard focus
  182. /// </summary>
  183. WM_KEYUP = 0x0101,
  184. /// <summary>
  185. /// The WM_CHAR message is posted to the window with the keyboard focus when a
  186. /// WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR
  187. /// message contains the character code of the key that was pressed
  188. /// </summary>
  189. WM_CHAR = 0x0102,
  190. /// <summary>
  191. /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a
  192. /// WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR
  193. /// specifies a character code generated by a dead key. A dead key is a key that
  194. /// generates a character, such as the umlaut (double-dot), that is combined with
  195. /// another character to form a composite character. For example, the umlaut-O
  196. /// character (? is generated by typing the dead key for the umlaut character,
  197. /// and then typing the O key
  198. /// </summary>
  199. WM_DEADCHAR = 0x0103,
  200. /// <summary>
  201. /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when
  202. /// the user presses the F10 key (which activates the menu bar) or holds down the
  203. /// ALT key and then presses another key. It also occurs when no window currently
  204. /// has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the
  205. /// active window. The window that receives the message can distinguish between
  206. /// these two contexts by checking the context code in the lParam parameter
  207. /// </summary>
  208. WM_SYSKEYDOWN = 0x0104,
  209. /// <summary>
  210. /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when
  211. /// the user releases a key that was pressed while the ALT key was held down. It
  212. /// also occurs when no window currently has the keyboard focus; in this case, the
  213. /// WM_SYSKEYUP message is sent to the active window. The window that receives the
  214. /// message can distinguish between these two contexts by checking the context code
  215. /// in the lParam parameter
  216. /// </summary>
  217. WM_SYSKEYUP = 0x0105,
  218. /// <summary>
  219. /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse
  220. /// is not captured, the message is posted to the window that contains the cursor.
  221. /// Otherwise, the message is posted to the window that has captured the mouse
  222. /// </summary>
  223. WM_MOUSEMOVE = 0x0200,
  224. /// <summary>
  225. /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button
  226. /// while the cursor is in the client area of a window. If the mouse is not captured,
  227. /// the message is posted to the window beneath the cursor. Otherwise, the message is
  228. /// posted to the window that has captured the mouse
  229. /// </summary>
  230. WM_LBUTTONDOWN = 0x0201,
  231. /// <summary>
  232. /// The WM_LBUTTONUP message is posted when the user releases the left mouse button
  233. /// while the cursor is in the client area of a window. If the mouse is not captured,
  234. /// the message is posted to the window beneath the cursor. Otherwise, the message is
  235. /// posted to the window that has captured the mouse
  236. /// </summary>
  237. WM_LBUTTONUP = 0x0202,
  238. /// <summary>
  239. /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse
  240. /// button while the cursor is in the client area of a window. If the mouse is not
  241. /// captured, the message is posted to the window beneath the cursor. Otherwise, the
  242. /// message is posted to the window that has captured the mouse
  243. /// </summary>
  244. WM_LBUTTONDBLCLK = 0x0203,
  245. /// <summary>
  246. /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button
  247. /// while the cursor is in the client area of a window. If the mouse is not captured,
  248. /// the message is posted to the window beneath the cursor. Otherwise, the message is
  249. /// posted to the window that has captured the mouse
  250. /// </summary>
  251. WM_RBUTTONDOWN = 0x0204,
  252. /// <summary>
  253. /// The WM_RBUTTONUP message is posted when the user releases the right mouse button
  254. /// while the cursor is in the client area of a window. If the mouse is not captured,
  255. /// the message is posted to the window beneath the cursor. Otherwise, the message is
  256. /// posted to the window that has captured the mouse
  257. /// </summary>
  258. WM_RBUTTONUP = 0x0205,
  259. /// <summary>
  260. /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse
  261. /// button while the cursor is in the client area of a window. If the mouse is not
  262. /// captured, the message is posted to the window beneath the cursor. Otherwise, the
  263. /// message is posted to the window that has captured the mouse
  264. /// </summary>
  265. WM_RBUTTONDBLCLK = 0x0206,
  266. /// <summary>
  267. /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button
  268. /// while the cursor is in the client area of a window. If the mouse is not captured,
  269. /// the message is posted to the window beneath the cursor. Otherwise, the message is
  270. /// posted to the window that has captured the mouse
  271. /// </summary>
  272. WM_MBUTTONDOWN = 0x0207,
  273. /// <summary>
  274. /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button
  275. /// while the cursor is in the client area of a window. If the mouse is not captured,
  276. /// the message is posted to the window beneath the cursor. Otherwise, the message is
  277. /// posted to the window that has captured the mouse
  278. /// </summary>
  279. WM_MBUTTONUP = 0x0208,
  280. /// <summary>
  281. /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse
  282. /// button while the cursor is in the client area of a window. If the mouse is not
  283. /// captured, the message is posted to the window beneath the cursor. Otherwise, the
  284. /// message is posted to the window that has captured the mouse
  285. /// </summary>
  286. WM_MBUTTONDBLCLK = 0x0209,
  287. /// <summary>
  288. /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X
  289. /// button while the cursor is in the client area of a window. If the mouse is not captured,
  290. /// the message is posted to the window beneath the cursor. Otherwise, the message is
  291. /// posted to the window that has captured the mouse
  292. /// </summary>
  293. WM_XBUTTONDOWN = 0x020B,
  294. /// <summary>
  295. /// The WM_XBUTTONUP message is posted when the user releases the first or second X
  296. /// button while the cursor is in the client area of a window. If the mouse is not
  297. /// captured, the message is posted to the window beneath the cursor. Otherwise, the
  298. /// message is posted to the window that has captured the mouse
  299. /// </summary>
  300. WM_XBUTTONUP = 0x020C,
  301. /// <summary>
  302. /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or
  303. /// second X button while the cursor is in the client area of a window. If the mouse
  304. /// is not captured, the message is posted to the window beneath the cursor. Otherwise,
  305. /// the message is posted to the window that has captured the mouse
  306. /// </summary>
  307. WM_XBUTTONDBLCLK = 0x020D,
  308. /// <summary>
  309. /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is
  310. /// rotated. The DefWindowProc function propagates the message to the window's parent.
  311. /// There should be no internal forwarding of the message, since DefWindowProc propagates
  312. /// it up the parent chain until it finds a window that processes it
  313. /// </summary>
  314. WM_MOUSEWHEEL = 0x020A
  315. }
  316. }