WindowsMessages.cs 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // hardcodet.net NotifyIcon for WPF
  2. // Copyright (c) 2009 - 2013 Philipp Sumi
  3. // Contact and Information: http://www.hardcodet.net
  4. //
  5. // This library is free software; you can redistribute it and/or
  6. // modify it under the terms of the Code Project Open License (CPOL);
  7. // either version 1.0 of the License, or (at your option) any later
  8. // version.
  9. //
  10. // The above copyright notice and this permission notice shall be
  11. // included in all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  15. // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  16. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  17. // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  18. // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. // OTHER DEALINGS IN THE SOFTWARE.
  21. //
  22. // THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
  23. // ReSharper disable InconsistentNaming
  24. using System.Diagnostics.CodeAnalysis;
  25. namespace Hardcodet.Wpf.TaskbarNotification.Interop
  26. {
  27. /// <summary>
  28. /// This enum defines the windows messages we respond to.
  29. /// See more on Windows messages <a href="https://docs.microsoft.com/en-us/windows/win32/learnwin32/window-messages">here</a>
  30. /// </summary>
  31. [SuppressMessage("ReSharper", "IdentifierTypo")]
  32. public enum WindowsMessages : uint
  33. {
  34. /// <summary>
  35. /// Notifies a window that the user clicked the right mouse button (right-clicked) in the window.
  36. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/menurc/wm-contextmenu">WM_CONTEXTMENU message</a>
  37. ///
  38. /// In case of a notify icon:
  39. /// If a user selects a notify icon's shortcut menu with the keyboard, the Shell now sends the associated application a WM_CONTEXTMENU message. Earlier versions send WM_RBUTTONDOWN and WM_RBUTTONUP messages.
  40. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw">Shell_NotifyIcon function</a>
  41. /// </summary>
  42. WM_CONTEXTMENU = 0x007b,
  43. /// <summary>
  44. /// Posted to a window when the cursor moves.
  45. /// If the mouse is not captured, the message is posted to the window that contains the cursor.
  46. /// Otherwise, the message is posted to the window that has captured the mouse.
  47. ///
  48. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousemove">WM_MOUSEMOVE message</a>
  49. /// </summary>
  50. WM_MOUSEMOVE = 0x0200,
  51. /// <summary>
  52. /// Posted when the user presses the left mouse button while the cursor is in the client area of a window.
  53. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  54. /// Otherwise, the message is posted to the window that has captured the mouse.
  55. ///
  56. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondown">WM_LBUTTONDOWN message</a>
  57. /// </summary>
  58. WM_LBUTTONDOWN = 0x0201,
  59. /// <summary>
  60. /// Posted when the user releases the left mouse button while the cursor is in the client area of a window.
  61. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  62. /// Otherwise, the message is posted to the window that has captured the mouse.
  63. ///
  64. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttonup">WM_LBUTTONUP message</a>
  65. /// </summary>
  66. WM_LBUTTONUP = 0x0202,
  67. /// <summary>
  68. /// Posted when the user double-clicks the left mouse button while the cursor is in the client area of a window.
  69. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  70. /// Otherwise, the message is posted to the window that has captured the mouse.
  71. ///
  72. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondblclk">WM_LBUTTONDBLCLK message</a>
  73. /// </summary>
  74. WM_LBUTTONDBLCLK = 0x0203,
  75. /// <summary>
  76. /// Posted when the user presses the right mouse button while the cursor is in the client area of a window.
  77. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  78. /// Otherwise, the message is posted to the window that has captured the mouse.
  79. ///
  80. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-rbuttondown">WM_RBUTTONDOWN message</a>
  81. /// </summary>
  82. WM_RBUTTONDOWN = 0x0204,
  83. /// <summary>
  84. /// Posted when the user releases the right mouse button while the cursor is in the client area of a window.
  85. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  86. /// Otherwise, the message is posted to the window that has captured the mouse.
  87. ///
  88. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-rbuttonup">WM_RBUTTONUP message</a>
  89. /// </summary>
  90. WM_RBUTTONUP = 0x0205,
  91. /// <summary>
  92. /// Posted when the user double-clicks the right mouse button while the cursor is in the client area of a window.
  93. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  94. /// Otherwise, the message is posted to the window that has captured the mouse.
  95. ///
  96. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-rbuttondblclk">WM_RBUTTONDBLCLK message</a>
  97. /// </summary>
  98. WM_RBUTTONDBLCLK = 0x0206,
  99. /// <summary>
  100. /// Posted when the user presses the middle mouse button while the cursor is in the client area of a window.
  101. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  102. /// Otherwise, the message is posted to the window that has captured the mouse.
  103. ///
  104. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mbuttondown">WM_MBUTTONDOWN message</a>
  105. /// </summary>
  106. WM_MBUTTONDOWN = 0x0207,
  107. /// <summary>
  108. /// Posted when the user releases the middle mouse button while the cursor is in the client area of a window.
  109. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  110. /// Otherwise, the message is posted to the window that has captured the mouse.
  111. ///
  112. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mbuttonup">WM_MBUTTONUP message</a>
  113. /// </summary>
  114. WM_MBUTTONUP = 0x0208,
  115. /// <summary>
  116. /// Posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window.
  117. /// If the mouse is not captured, the message is posted to the window beneath the cursor.
  118. /// Otherwise, the message is posted to the window that has captured the mouse.
  119. ///
  120. /// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mbuttondblclk">WM_MBUTTONDBLCLK message</a>
  121. /// </summary>
  122. WM_MBUTTONDBLCLK = 0x0209,
  123. /// <summary>
  124. /// Used to define private messages for use by private window classes, usually of the form WM_USER+x, where x is an integer value.
  125. /// </summary>
  126. WM_USER = 0x0400,
  127. /// <summary>
  128. /// This message is only send when using NOTIFYICON_VERSION_4, the Shell now sends the associated application an NIN_SELECT notification.
  129. /// Send when a notify icon is activated with mouse or ENTER key.
  130. /// Earlier versions send WM_RBUTTONDOWN and WM_RBUTTONUP messages.
  131. /// </summary>
  132. NIN_SELECT = WM_USER,
  133. /// <summary>
  134. /// This message is only send when using NOTIFYICON_VERSION_4, the Shell now sends the associated application an NIN_SELECT notification.
  135. /// Send when a notify icon is activated with SPACEBAR or ENTER key.
  136. /// Earlier versions send WM_RBUTTONDOWN and WM_RBUTTONUP messages.
  137. /// </summary>
  138. NIN_KEYSELECT = WM_USER + 1,
  139. /// <summary>
  140. /// Sent when the balloon is shown (balloons are queued).
  141. /// </summary>
  142. NIN_BALLOONSHOW = WM_USER + 2,
  143. /// <summary>
  144. /// Sent when the balloon disappears. For example, when the icon is deleted.
  145. /// This message is not sent if the balloon is dismissed because of a timeout or if the user clicks the mouse.
  146. ///
  147. /// As of Windows 7, NIN_BALLOONHIDE is also sent when a notification with the NIIF_RESPECT_QUIET_TIME flag set attempts to display during quiet time (a user's first hour on a new computer).
  148. /// In that case, the balloon is never displayed at all.
  149. /// </summary>
  150. NIN_BALLOONHIDE = WM_USER + 3,
  151. /// <summary>
  152. /// Sent when the balloon is dismissed because of a timeout.
  153. /// </summary>
  154. NIN_BALLOONTIMEOUT = WM_USER + 4,
  155. /// <summary>
  156. /// Sent when the balloon is dismissed because the user clicked the mouse.
  157. /// </summary>
  158. NIN_BALLOONUSERCLICK = WM_USER + 5,
  159. /// <summary>
  160. /// Sent when the user hovers the cursor over an icon to indicate that the richer pop-up UI should be used in place of a standard textual tooltip.
  161. /// </summary>
  162. NIN_POPUPOPEN = WM_USER + 6,
  163. /// <summary>
  164. /// Sent when a cursor no longer hovers over an icon to indicate that the rich pop-up UI should be closed.
  165. /// </summary>
  166. NIN_POPUPCLOSE = WM_USER + 7
  167. }
  168. }