Zzz – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 using System;
2 using System.Drawing;
3 using System.Runtime.InteropServices;
4  
5 namespace Zzz.Idle
6 {
7 public class WindowsHookHelper
8 {
9 #region Public Events & Delegates
10  
11 public delegate IntPtr HookDelegate(
12 int code, IntPtr wParam, IntPtr lParam);
13  
14 #endregion
15  
16 #region Public Enums, Properties and Fields
17  
18 /// <summary>
19 /// Windows Messages
20 /// Defined in winuser.h from Windows SDK v6.1
21 /// Documentation pulled from MSDN.
22 /// </summary>
23 public enum WM : uint
24 {
25 /// <summary>
26 /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message
27 /// that the recipient window will ignore.
28 /// </summary>
29 NULL = 0x0000,
30  
31 /// <summary>
32 /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx
33 /// or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window
34 /// receives this message after the window is created, but before the window becomes visible.
35 /// </summary>
36 CREATE = 0x0001,
37  
38 /// <summary>
39 /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window
40 /// being destroyed after the window is removed from the screen.
41 /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are
42 /// destroyed. During the processing of the message, it can be assumed that all child windows still exist.
43 /// ///
44 /// </summary>
45 DESTROY = 0x0002,
46  
47 /// <summary>
48 /// The WM_MOVE message is sent after a window has been moved.
49 /// </summary>
50 MOVE = 0x0003,
51  
52 /// <summary>
53 /// The WM_SIZE message is sent to a window after its size has changed.
54 /// </summary>
55 SIZE = 0x0005,
56  
57 /// <summary>
58 /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows
59 /// use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window
60 /// being deactivated, then to the window procedure of the top-level window being activated. If the windows use
61 /// different input queues, the message is sent asynchronously, so the window is activated immediately.
62 /// </summary>
63 ACTIVATE = 0x0006,
64  
65 /// <summary>
66 /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus.
67 /// </summary>
68 SETFOCUS = 0x0007,
69  
70 /// <summary>
71 /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.
72 /// </summary>
73 KILLFOCUS = 0x0008,
74  
75 /// <summary>
76 /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window
77 /// whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the
78 /// enabled state (WS_DISABLED style bit) of the window has changed.
79 /// </summary>
80 ENABLE = 0x000A,
81  
82 /// <summary>
83 /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to
84 /// prevent changes in that window from being redrawn.
85 /// </summary>
86 SETREDRAW = 0x000B,
87  
88 /// <summary>
89 /// An application sends a WM_SETTEXT message to set the text of a window.
90 /// </summary>
91 SETTEXT = 0x000C,
92  
93 /// <summary>
94 /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by
95 /// the caller.
96 /// </summary>
97 GETTEXT = 0x000D,
98  
99 /// <summary>
100 /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with
101 /// a window.
102 /// </summary>
103 GETTEXTLENGTH = 0x000E,
104  
105 /// <summary>
106 /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an
107 /// application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the
108 /// DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage
109 /// function.
110 /// </summary>
111 PAINT = 0x000F,
112  
113 /// <summary>
114 /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.
115 /// </summary>
116 CLOSE = 0x0010,
117  
118 /// <summary>
119 /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of
120 /// the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending
121 /// WM_QUERYENDSESSION messages as soon as one application returns zero.
122 /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the
123 /// results of the WM_QUERYENDSESSION message.
124 /// </summary>
125 QUERYENDSESSION = 0x0011,
126  
127 /// <summary>
128 /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size
129 /// and position.
130 /// </summary>
131 QUERYOPEN = 0x0013,
132  
133 /// <summary>
134 /// The WM_ENDSESSION message is sent to an application after the system processes the results of the
135 /// WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.
136 /// </summary>
137 ENDSESSION = 0x0016,
138  
139 /// <summary>
140 /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the
141 /// PostQuitMessage function. It causes the GetMessage function to return zero.
142 /// </summary>
143 QUIT = 0x0012,
144  
145 /// <summary>
146 /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is
147 /// resized). The message is sent to prepare an invalidated portion of a window for painting.
148 /// </summary>
149 ERASEBKGND = 0x0014,
150  
151 /// <summary>
152 /// This message is sent to all top-level windows when a change is made to a system color setting.
153 /// </summary>
154 SYSCOLORCHANGE = 0x0015,
155  
156 /// <summary>
157 /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.
158 /// </summary>
159 SHOWWINDOW = 0x0018,
160  
161 /// <summary>
162 /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI
163 /// file. The SystemParametersInfo function sends this message after an application uses the function to change a
164 /// setting in WIN.INI.
165 /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system.
166 /// Applications should use the WM_SETTINGCHANGE message.
167 /// </summary>
168 WININICHANGE = 0x001A,
169  
170 /// <summary>
171 /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI
172 /// file. The SystemParametersInfo function sends this message after an application uses the function to change a
173 /// setting in WIN.INI.
174 /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system.
175 /// Applications should use the WM_SETTINGCHANGE message.
176 /// </summary>
177 SETTINGCHANGE = WININICHANGE,
178  
179 /// <summary>
180 /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings.
181 /// </summary>
182 DEVMODECHANGE = 0x001B,
183  
184 /// <summary>
185 /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is
186 /// about to be activated. The message is sent to the application whose window is being activated and to the
187 /// application whose window is being deactivated.
188 /// </summary>
189 ACTIVATEAPP = 0x001C,
190  
191 /// <summary>
192 /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of
193 /// font resources.
194 /// </summary>
195 FONTCHANGE = 0x001D,
196  
197 /// <summary>
198 /// A message that is sent whenever there is a change in the system time.
199 /// </summary>
200 TIMECHANGE = 0x001E,
201  
202 /// <summary>
203 /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends
204 /// this message to the active window when a dialog box or message box is displayed. Certain functions also send this
205 /// message explicitly to the specified window regardless of whether it is the active window. For example, the
206 /// EnableWindow function sends this message when disabling the specified window.
207 /// </summary>
208 CANCELMODE = 0x001F,
209  
210 /// <summary>
211 /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input
212 /// is not captured.
213 /// </summary>
214 SETCURSOR = 0x0020,
215  
216 /// <summary>
217 /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button.
218 /// The parent window receives this message only if the child window passes it to the DefWindowProc function.
219 /// </summary>
220 MOUSEACTIVATE = 0x0021,
221  
222 /// <summary>
223 /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the
224 /// window is activated, moved, or sized.
225 /// </summary>
226 CHILDACTIVATE = 0x0022,
227  
228 /// <summary>
229 /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages
230 /// from other messages sent through the WH_JOURNALPLAYBACK Hook procedure.
231 /// </summary>
232 QUEUESYNC = 0x0023,
233  
234 /// <summary>
235 /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An
236 /// application can use this message to override the window's default maximized size and position, or its default
237 /// minimum or maximum tracking size.
238 /// </summary>
239 GETMINMAXINFO = 0x0024,
240  
241 /// <summary>
242 /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted.
243 /// This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the
244 /// Remarks.
245 /// </summary>
246 PAINTICON = 0x0026,
247  
248 /// <summary>
249 /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the
250 /// icon must be filled before painting the icon. A window receives this message only if a class icon is defined for
251 /// the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.
252 /// </summary>
253 ICONERASEBKGND = 0x0027,
254  
255 /// <summary>
256 /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the
257 /// dialog box.
258 /// </summary>
259 NEXTDLGCTL = 0x0028,
260  
261 /// <summary>
262 /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print
263 /// Manager queue.
264 /// </summary>
265 SPOOLERSTATUS = 0x002A,
266  
267 /// <summary>
268 /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a
269 /// visual aspect of the button, combo box, list box, or menu has changed.
270 /// </summary>
271 DRAWITEM = 0x002B,
272  
273 /// <summary>
274 /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item
275 /// when the control or menu is created.
276 /// </summary>
277 MEASUREITEM = 0x002C,
278  
279 /// <summary>
280 /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed
281 /// by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a
282 /// WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or
283 /// combo box item with nonzero item data.
284 /// </summary>
285 DELETEITEM = 0x002D,
286  
287 /// <summary>
288 /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.
289 /// </summary>
290 VKEYTOITEM = 0x002E,
291  
292 /// <summary>
293 /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message.
294 /// </summary>
295 CHARTOITEM = 0x002F,
296  
297 /// <summary>
298 /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text.
299 /// </summary>
300 SETFONT = 0x0030,
301  
302 /// <summary>
303 /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently
304 /// drawing its text.
305 /// </summary>
306 GETFONT = 0x0031,
307  
308 /// <summary>
309 /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user
310 /// presses the hot key, the system activates the window.
311 /// </summary>
312 SETHOTKEY = 0x0032,
313  
314 /// <summary>
315 /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window.
316 /// </summary>
317 GETHOTKEY = 0x0033,
318  
319 /// <summary>
320 /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user
321 /// but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The
322 /// system displays this cursor or icon while the user drags the icon.
323 /// </summary>
324 QUERYDRAGICON = 0x0037,
325  
326 /// <summary>
327 /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of
328 /// an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to
329 /// the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style.
330 /// </summary>
331 COMPAREITEM = 0x0039,
332  
333 /// <summary>
334 /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a
335 /// server application.
336 /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to
337 /// AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications
338 /// handle this message.
339 /// </summary>
340 GETOBJECT = 0x003D,
341  
342 /// <summary>
343 /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system
344 /// time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.
345 /// </summary>
346 COMPACTING = 0x0041,
347  
348 /// <summary>
349 /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications
350 /// </summary>
351 [Obsolete] COMMNOTIFY = 0x0044,
352  
353 /// <summary>
354 /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to
355 /// change as a result of a call to the SetWindowPos function or another window-management function.
356 /// </summary>
357 WINDOWPOSCHANGING = 0x0046,
358  
359 /// <summary>
360 /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a
361 /// result of a call to the SetWindowPos function or another window-management function.
362 /// </summary>
363 WINDOWPOSCHANGED = 0x0047,
364  
365 /// <summary>
366 /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended
367 /// mode.
368 /// Use: POWERBROADCAST
369 /// </summary>
370 [Obsolete] POWER = 0x0048,
371  
372 /// <summary>
373 /// An application sends the WM_COPYDATA message to pass data to another application.
374 /// </summary>
375 COPYDATA = 0x004A,
376  
377 /// <summary>
378 /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling
379 /// activities. The message is posted with a NULL window handle.
380 /// </summary>
381 CANCELJOURNAL = 0x004B,
382  
383 /// <summary>
384 /// Sent by a common control to its parent window when an event has occurred or the control requires some information.
385 /// </summary>
386 NOTIFY = 0x004E,
387  
388 /// <summary>
389 /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input
390 /// language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the
391 /// system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject
392 /// the change (and prevent it from taking place) by returning immediately.
393 /// </summary>
394 INPUTLANGCHANGEREQUEST = 0x0050,
395  
396 /// <summary>
397 /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has
398 /// been changed. You should make any application-specific settings and pass the message to the DefWindowProc function,
399 /// which passes the message to all first-level child windows. These child windows can pass the message to
400 /// DefWindowProc to have it pass the message to their child windows, and so on.
401 /// </summary>
402 INPUTLANGCHANGE = 0x0051,
403  
404 /// <summary>
405 /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the
406 /// application when the user clicks an authorable button. An application initiates a training card by specifying the
407 /// HELP_TCARD command in a call to the WinHelp function.
408 /// </summary>
409 TCARD = 0x0052,
410  
411 /// <summary>
412 /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window
413 /// associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has
414 /// the keyboard focus, WM_HELP is sent to the currently active window.
415 /// </summary>
416 HELP = 0x0053,
417  
418 /// <summary>
419 /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or
420 /// off, the system updates the user-specific settings. The system sends this message immediately after updating the
421 /// settings.
422 /// </summary>
423 USERCHANGED = 0x0054,
424  
425 /// <summary>
426 /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT
427 /// messages are sent from a common control to its parent window and from the parent window to the common control.
428 /// </summary>
429 NOTIFYFORMAT = 0x0055,
430  
431 /// <summary>
432 /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the
433 /// window.
434 /// </summary>
435 CONTEXTMENU = 0x007B,
436  
437 /// <summary>
438 /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of
439 /// the window's styles.
440 /// </summary>
441 STYLECHANGING = 0x007C,
442  
443 /// <summary>
444 /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the
445 /// window's styles
446 /// </summary>
447 STYLECHANGED = 0x007D,
448  
449 /// <summary>
450 /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.
451 /// </summary>
452 DISPLAYCHANGE = 0x007E,
453  
454 /// <summary>
455 /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a
456 /// window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption.
457 /// </summary>
458 GETICON = 0x007F,
459  
460 /// <summary>
461 /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system
462 /// displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.
463 /// </summary>
464 SETICON = 0x0080,
465  
466 /// <summary>
467 /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.
468 /// </summary>
469 NCCREATE = 0x0081,
470  
471 /// <summary>
472 /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function
473 /// sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the
474 /// allocated memory object associated with the window.
475 /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent
476 /// before the child windows are destroyed.
477 /// </summary>
478 NCDESTROY = 0x0082,
479  
480 /// <summary>
481 /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By
482 /// processing this message, an application can control the content of the window's client area when the size or
483 /// position of the window changes.
484 /// </summary>
485 NCCALCSIZE = 0x0083,
486  
487 /// <summary>
488 /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released.
489 /// If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent
490 /// to the window that has captured the mouse.
491 /// </summary>
492 NCHITTEST = 0x0084,
493  
494 /// <summary>
495 /// The WM_NCPAINT message is sent to a window when its frame must be painted.
496 /// </summary>
497 NCPAINT = 0x0085,
498  
499 /// <summary>
500 /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or
501 /// inactive state.
502 /// </summary>
503 NCACTIVATE = 0x0086,
504  
505 /// <summary>
506 /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles
507 /// all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation
508 /// keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types
509 /// of input it wants to process itself.
510 /// </summary>
511 GETDLGCODE = 0x0087,
512  
513 /// <summary>
514 /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.
515 /// </summary>
516 SYNCPAINT = 0x0088,
517  
518 /// <summary>
519 /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window.
520 /// This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is
521 /// not posted.
522 /// </summary>
523 NCMOUSEMOVE = 0x00A0,
524  
525 /// <summary>
526 /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the
527 /// nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured
528 /// the mouse, this message is not posted.
529 /// </summary>
530 NCLBUTTONDOWN = 0x00A1,
531  
532 /// <summary>
533 /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the
534 /// nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured
535 /// the mouse, this message is not posted.
536 /// </summary>
537 NCLBUTTONUP = 0x00A2,
538  
539 /// <summary>
540 /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is
541 /// within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window
542 /// has captured the mouse, this message is not posted.
543 /// </summary>
544 NCLBUTTONDBLCLK = 0x00A3,
545  
546 /// <summary>
547 /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the
548 /// nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured
549 /// the mouse, this message is not posted.
550 /// </summary>
551 NCRBUTTONDOWN = 0x00A4,
552  
553 /// <summary>
554 /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the
555 /// nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured
556 /// the mouse, this message is not posted.
557 /// </summary>
558 NCRBUTTONUP = 0x00A5,
559  
560 /// <summary>
561 /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is
562 /// within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window
563 /// has captured the mouse, this message is not posted.
564 /// </summary>
565 NCRBUTTONDBLCLK = 0x00A6,
566  
567 /// <summary>
568 /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the
569 /// nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured
570 /// the mouse, this message is not posted.
571 /// </summary>
572 NCMBUTTONDOWN = 0x00A7,
573  
574 /// <summary>
575 /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the
576 /// nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured
577 /// the mouse, this message is not posted.
578 /// </summary>
579 NCMBUTTONUP = 0x00A8,
580  
581 /// <summary>
582 /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is
583 /// within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window
584 /// has captured the mouse, this message is not posted.
585 /// </summary>
586 NCMBUTTONDBLCLK = 0x00A9,
587  
588 /// <summary>
589 /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in
590 /// the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has
591 /// captured the mouse, this message is not posted.
592 /// </summary>
593 NCXBUTTONDOWN = 0x00AB,
594  
595 /// <summary>
596 /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the
597 /// nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured
598 /// the mouse, this message is not posted.
599 /// </summary>
600 NCXBUTTONUP = 0x00AC,
601  
602 /// <summary>
603 /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor
604 /// is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window
605 /// has captured the mouse, this message is not posted.
606 /// </summary>
607 NCXBUTTONDBLCLK = 0x00AD,
608  
609 /// <summary>
610 /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives
611 /// this message through its WindowProc function.
612 /// </summary>
613 INPUT_DEVICE_CHANGE = 0x00FE,
614  
615 /// <summary>
616 /// The WM_INPUT message is sent to the window that is getting raw input.
617 /// </summary>
618 INPUT = 0x00FF,
619  
620 /// <summary>
621 /// This message filters for keyboard messages.
622 /// </summary>
623 KEYFIRST = 0x0100,
624  
625 /// <summary>
626 /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem
627 /// key is a key that is pressed when the ALT key is not pressed.
628 /// </summary>
629 KEYDOWN = 0x0100,
630  
631 /// <summary>
632 /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem
633 /// key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has
634 /// the keyboard focus.
635 /// </summary>
636 KEYUP = 0x0101,
637  
638 /// <summary>
639 /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the
640 /// TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.
641 /// </summary>
642 CHAR = 0x0102,
643  
644 /// <summary>
645 /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by
646 /// the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key
647 /// that generates a character, such as the umlaut (double-dot), that is combined with another character to form a
648 /// composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut
649 /// character, and then typing the O key.
650 /// </summary>
651 DEADCHAR = 0x0103,
652  
653 /// <summary>
654 /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which
655 /// activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window
656 /// currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window
657 /// that receives the message can distinguish between these two contexts by checking the context code in the lParam
658 /// parameter.
659 /// </summary>
660 SYSKEYDOWN = 0x0104,
661  
662 /// <summary>
663 /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was
664 /// pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this
665 /// case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish
666 /// between these two contexts by checking the context code in the lParam parameter.
667 /// </summary>
668 SYSKEYUP = 0x0105,
669  
670 /// <summary>
671 /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated
672 /// by the TranslateMessage function. It specifies the character code of a system character key — that is, a character
673 /// key that is pressed while the ALT key is down.
674 /// </summary>
675 SYSCHAR = 0x0106,
676  
677 /// <summary>
678 /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated
679 /// by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a
680 /// dead key that is pressed while holding down the ALT key.
681 /// </summary>
682 SYSDEADCHAR = 0x0107,
683  
684 /// <summary>
685 /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by
686 /// the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed.
687 /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas
688 /// WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle
689 /// Unicode Supplementary Plane characters.
690 /// </summary>
691 UNICHAR = 0x0109,
692  
693 /// <summary>
694 /// This message filters for keyboard messages.
695 /// </summary>
696 KEYLAST = 0x0108,
697  
698 /// <summary>
699 /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this
700 /// message through its WindowProc function.
701 /// </summary>
702 IME_STARTCOMPOSITION = 0x010D,
703  
704 /// <summary>
705 /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc
706 /// function.
707 /// </summary>
708 IME_ENDCOMPOSITION = 0x010E,
709  
710 /// <summary>
711 /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this
712 /// message through its WindowProc function.
713 /// </summary>
714 IME_COMPOSITION = 0x010F,
715  
716 IME_KEYLAST = 0x010F,
717  
718 /// <summary>
719 /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog
720 /// box procedures typically use this message to initialize controls and carry out any other initialization tasks that
721 /// affect the appearance of the dialog box.
722 /// </summary>
723 INITDIALOG = 0x0110,
724  
725 /// <summary>
726 /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a
727 /// notification message to its parent window, or when an accelerator keystroke is translated.
728 /// </summary>
729 COMMAND = 0x0111,
730  
731 /// <summary>
732 /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button,
733 /// minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering
734 /// this out.
735 /// </summary>
736 SYSCOMMAND = 0x0112,
737  
738 /// <summary>
739 /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted
740 /// by the GetMessage or PeekMessage function.
741 /// </summary>
742 TIMER = 0x0113,
743  
744 /// <summary>
745 /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll
746 /// bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the
747 /// control.
748 /// </summary>
749 HSCROLL = 0x0114,
750  
751 /// <summary>
752 /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar.
753 /// This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
754 /// </summary>
755 VSCROLL = 0x0115,
756  
757 /// <summary>
758 /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on
759 /// the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed.
760 /// </summary>
761 INITMENU = 0x0116,
762  
763 /// <summary>
764 /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an
765 /// application to modify the menu before it is displayed, without changing the entire menu.
766 /// </summary>
767 INITMENUPOPUP = 0x0117,
768  
769 /// <summary>
770 /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item.
771 /// </summary>
772 MENUSELECT = 0x011F,
773  
774 /// <summary>
775 /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any
776 /// mnemonic or accelerator key. This message is sent to the window that owns the menu.
777 /// </summary>
778 MENUCHAR = 0x0120,
779  
780 /// <summary>
781 /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state.
782 /// A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed
783 /// one or more previous messages.
784 /// </summary>
785 ENTERIDLE = 0x0121,
786  
787 /// <summary>
788 /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu
789 /// item.
790 /// </summary>
791 MENURBUTTONUP = 0x0122,
792  
793 /// <summary>
794 /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item.
795 /// </summary>
796 MENUDRAG = 0x0123,
797  
798 /// <summary>
799 /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item
800 /// or moves from the center of the item to the top or bottom of the item.
801 /// </summary>
802 MENUGETOBJECT = 0x0124,
803  
804 /// <summary>
805 /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed.
806 /// </summary>
807 UNINITMENUPOPUP = 0x0125,
808  
809 /// <summary>
810 /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.
811 /// </summary>
812 MENUCOMMAND = 0x0126,
813  
814 /// <summary>
815 /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.
816 /// </summary>
817 CHANGEUISTATE = 0x0127,
818  
819 /// <summary>
820 /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window
821 /// and all its child windows.
822 /// </summary>
823 UPDATEUISTATE = 0x0128,
824  
825 /// <summary>
826 /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.
827 /// </summary>
828 QUERYUISTATE = 0x0129,
829  
830 /// <summary>
831 /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By
832 /// responding to this message, the owner window can set the text and background colors of the message box by using the
833 /// given display device context handle.
834 /// </summary>
835 CTLCOLORMSGBOX = 0x0132,
836  
837 /// <summary>
838 /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the
839 /// control is about to be drawn. By responding to this message, the parent window can use the specified device context
840 /// handle to set the text and background colors of the edit control.
841 /// </summary>
842 CTLCOLOREDIT = 0x0133,
843  
844 /// <summary>
845 /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the
846 /// parent window can set the text and background colors of the list box by using the specified display device context
847 /// handle.
848 /// </summary>
849 CTLCOLORLISTBOX = 0x0134,
850  
851 /// <summary>
852 /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window
853 /// can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window
854 /// processing this message.
855 /// </summary>
856 CTLCOLORBTN = 0x0135,
857  
858 /// <summary>
859 /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this
860 /// message, the dialog box can set its text and background colors using the specified display device context handle.
861 /// </summary>
862 CTLCOLORDLG = 0x0136,
863  
864 /// <summary>
865 /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to
866 /// be drawn. By responding to this message, the parent window can use the display context handle to set the background
867 /// color of the scroll bar control.
868 /// </summary>
869 CTLCOLORSCROLLBAR = 0x0137,
870  
871 /// <summary>
872 /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its
873 /// parent window when the control is about to be drawn. By responding to this message, the parent window can use the
874 /// specified device context handle to set the text and background colors of the static control.
875 /// </summary>
876 CTLCOLORSTATIC = 0x0138,
877  
878 /// <summary>
879 /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.
880 /// </summary>
881 MOUSEFIRST = 0x0200,
882  
883 /// <summary>
884 /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is
885 /// posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the
886 /// mouse.
887 /// </summary>
888 MOUSEMOVE = 0x0200,
889  
890 /// <summary>
891 /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client
892 /// area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise,
893 /// the message is posted to the window that has captured the mouse.
894 /// </summary>
895 LBUTTONDOWN = 0x0201,
896  
897 /// <summary>
898 /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client
899 /// area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise,
900 /// the message is posted to the window that has captured the mouse.
901 /// </summary>
902 LBUTTONUP = 0x0202,
903  
904 /// <summary>
905 /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the
906 /// client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor.
907 /// Otherwise, the message is posted to the window that has captured the mouse.
908 /// </summary>
909 LBUTTONDBLCLK = 0x0203,
910  
911 /// <summary>
912 /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client
913 /// area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise,
914 /// the message is posted to the window that has captured the mouse.
915 /// </summary>
916 RBUTTONDOWN = 0x0204,
917  
918 /// <summary>
919 /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client
920 /// area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise,
921 /// the message is posted to the window that has captured the mouse.
922 /// </summary>
923 RBUTTONUP = 0x0205,
924  
925 /// <summary>
926 /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in
927 /// the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor.
928 /// Otherwise, the message is posted to the window that has captured the mouse.
929 /// </summary>
930 RBUTTONDBLCLK = 0x0206,
931  
932 /// <summary>
933 /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the
934 /// client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor.
935 /// Otherwise, the message is posted to the window that has captured the mouse.
936 /// </summary>
937 MBUTTONDOWN = 0x0207,
938  
939 /// <summary>
940 /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client
941 /// area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise,
942 /// the message is posted to the window that has captured the mouse.
943 /// </summary>
944 MBUTTONUP = 0x0208,
945  
946 /// <summary>
947 /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in
948 /// the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor.
949 /// Otherwise, the message is posted to the window that has captured the mouse.
950 /// </summary>
951 MBUTTONDBLCLK = 0x0209,
952  
953 /// <summary>
954 /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function
955 /// propagates the message to the window's parent. There should be no internal forwarding of the message, since
956 /// DefWindowProc propagates it up the parent chain until it finds a window that processes it.
957 /// </summary>
958 MOUSEWHEEL = 0x020A,
959  
960 /// <summary>
961 /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the
962 /// client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor.
963 /// Otherwise, the message is posted to the window that has captured the mouse.
964 /// </summary>
965 XBUTTONDOWN = 0x020B,
966  
967 /// <summary>
968 /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the
969 /// client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor.
970 /// Otherwise, the message is posted to the window that has captured the mouse.
971 /// </summary>
972 XBUTTONUP = 0x020C,
973  
974 /// <summary>
975 /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is
976 /// in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the
977 /// cursor. Otherwise, the message is posted to the window that has captured the mouse.
978 /// </summary>
979 XBUTTONDBLCLK = 0x020D,
980  
981 /// <summary>
982 /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or
983 /// rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal
984 /// forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that
985 /// processes it.
986 /// </summary>
987 MOUSEHWHEEL = 0x020E,
988  
989 /// <summary>
990 /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.
991 /// </summary>
992 MOUSELAST = 0x020E,
993  
994 /// <summary>
995 /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed,
996 /// or when the user clicks a mouse button while the cursor is over the child window. When the child window is being
997 /// created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the
998 /// window returns. When the child window is being destroyed, the system sends the message before any processing to
999 /// destroy the window takes place.
1000 /// </summary>
1001 PARENTNOTIFY = 0x0210,
1002  
1003 /// <summary>
1004 /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been
1005 /// entered.
1006 /// </summary>
1007 ENTERMENULOOP = 0x0211,
1008  
1009 /// <summary>
1010 /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited.
1011 /// </summary>
1012 EXITMENULOOP = 0x0212,
1013  
1014 /// <summary>
1015 /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the
1016 /// menu bar and the system menu.
1017 /// </summary>
1018 NEXTMENU = 0x0213,
1019  
1020 /// <summary>
1021 /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can
1022 /// monitor the size and position of the drag rectangle and, if needed, change its size or position.
1023 /// </summary>
1024 SIZING = 0x0214,
1025  
1026 /// <summary>
1027 /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.
1028 /// </summary>
1029 CAPTURECHANGED = 0x0215,
1030  
1031 /// <summary>
1032 /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can
1033 /// monitor the position of the drag rectangle and, if needed, change its position.
1034 /// </summary>
1035 MOVING = 0x0216,
1036  
1037 /// <summary>
1038 /// Notifies applications that a power-management event has occurred.
1039 /// </summary>
1040 POWERBROADCAST = 0x0218,
1041  
1042 /// <summary>
1043 /// Notifies an application of a change to the hardware configuration of a device or the computer.
1044 /// </summary>
1045 DEVICECHANGE = 0x0219,
1046  
1047 /// <summary>
1048 /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI
1049 /// child window.
1050 /// </summary>
1051 MDICREATE = 0x0220,
1052  
1053 /// <summary>
1054 /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI
1055 /// child window.
1056 /// </summary>
1057 MDIDESTROY = 0x0221,
1058  
1059 /// <summary>
1060 /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct
1061 /// the client window to activate a different MDI child window.
1062 /// </summary>
1063 MDIACTIVATE = 0x0222,
1064  
1065 /// <summary>
1066 /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an
1067 /// MDI child window from maximized or minimized size.
1068 /// </summary>
1069 MDIRESTORE = 0x0223,
1070  
1071 /// <summary>
1072 /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the
1073 /// next or previous child window.
1074 /// </summary>
1075 MDINEXT = 0x0224,
1076  
1077 /// <summary>
1078 /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an
1079 /// MDI child window. The system resizes the child window to make its client area fill the client window. The system
1080 /// places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the
1081 /// child window's restore icon in the leftmost position. The system also appends the title bar text of the child
1082 /// window to that of the frame window.
1083 /// </summary>
1084 MDIMAXIMIZE = 0x0225,
1085  
1086 /// <summary>
1087 /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of
1088 /// its MDI child windows in a tile format.
1089 /// </summary>
1090 MDITILE = 0x0226,
1091  
1092 /// <summary>
1093 /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all
1094 /// its child windows in a cascade format.
1095 /// </summary>
1096 MDICASCADE = 0x0227,
1097  
1098 /// <summary>
1099 /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange
1100 /// all minimized MDI child windows. It does not affect child windows that are not minimized.
1101 /// </summary>
1102 MDIICONARRANGE = 0x0228,
1103  
1104 /// <summary>
1105 /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve
1106 /// the handle to the active MDI child window.
1107 /// </summary>
1108 MDIGETACTIVE = 0x0229,
1109  
1110 /// <summary>
1111 /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the
1112 /// entire menu of an MDI frame window, to replace the window menu of the frame window, or both.
1113 /// </summary>
1114 MDISETMENU = 0x0230,
1115  
1116 /// <summary>
1117 /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The
1118 /// window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when
1119 /// the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message
1120 /// specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
1121 /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.
1122 /// </summary>
1123 ENTERSIZEMOVE = 0x0231,
1124  
1125 /// <summary>
1126 /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The
1127 /// window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when
1128 /// the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message
1129 /// specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
1130 /// </summary>
1131 EXITSIZEMOVE = 0x0232,
1132  
1133 /// <summary>
1134 /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of
1135 /// dropped files.
1136 /// </summary>
1137 DROPFILES = 0x0233,
1138  
1139 /// <summary>
1140 /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh
1141 /// the window menu of the MDI frame window.
1142 /// </summary>
1143 MDIREFRESHMENU = 0x0234,
1144  
1145 /// <summary>
1146 /// Sent to an application when a window is activated. A window receives this message through its WindowProc function.
1147 /// </summary>
1148 IME_SETCONTEXT = 0x0281,
1149  
1150 /// <summary>
1151 /// Sent to an application to notify it of changes to the IME window. A window receives this message through its
1152 /// WindowProc function.
1153 /// </summary>
1154 IME_NOTIFY = 0x0282,
1155  
1156 /// <summary>
1157 /// Sent by an application to direct the IME window to carry out the requested command. The application uses this
1158 /// message to control the IME window that it has created. To send this message, the application calls the SendMessage
1159 /// function with the following parameters.
1160 /// </summary>
1161 IME_CONTROL = 0x0283,
1162  
1163 /// <summary>
1164 /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window
1165 /// receives this message through its WindowProc function.
1166 /// </summary>
1167 IME_COMPOSITIONFULL = 0x0284,
1168  
1169 /// <summary>
1170 /// Sent to an application when the operating system is about to change the current IME. A window receives this message
1171 /// through its WindowProc function.
1172 /// </summary>
1173 IME_SELECT = 0x0285,
1174  
1175 /// <summary>
1176 /// Sent to an application when the IME gets a character of the conversion result. A window receives this message
1177 /// through its WindowProc function.
1178 /// </summary>
1179 IME_CHAR = 0x0286,
1180  
1181 /// <summary>
1182 /// Sent to an application to provide commands and request information. A window receives this message through its
1183 /// WindowProc function.
1184 /// </summary>
1185 IME_REQUEST = 0x0288,
1186  
1187 /// <summary>
1188 /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window
1189 /// receives this message through its WindowProc function.
1190 /// </summary>
1191 IME_KEYDOWN = 0x0290,
1192  
1193 /// <summary>
1194 /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window
1195 /// receives this message through its WindowProc function.
1196 /// </summary>
1197 IME_KEYUP = 0x0291,
1198  
1199 /// <summary>
1200 /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the
1201 /// period of time specified in a prior call to TrackMouseEvent.
1202 /// </summary>
1203 MOUSEHOVER = 0x02A1,
1204  
1205 /// <summary>
1206 /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a
1207 /// prior call to TrackMouseEvent.
1208 /// </summary>
1209 MOUSELEAVE = 0x02A3,
1210  
1211 /// <summary>
1212 /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for
1213 /// the period of time specified in a prior call to TrackMouseEvent.
1214 /// </summary>
1215 NCMOUSEHOVER = 0x02A0,
1216  
1217 /// <summary>
1218 /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified
1219 /// in a prior call to TrackMouseEvent.
1220 /// </summary>
1221 NCMOUSELEAVE = 0x02A2,
1222  
1223 /// <summary>
1224 /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.
1225 /// </summary>
1226 WTSSESSION_CHANGE = 0x02B1,
1227  
1228 TABLET_FIRST = 0x02c0,
1229  
1230 TABLET_LAST = 0x02df,
1231  
1232 /// <summary>
1233 /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if
1234 /// any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format.
1235 /// </summary>
1236 CUT = 0x0300,
1237  
1238 /// <summary>
1239 /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the
1240 /// clipboard in CF_TEXT format.
1241 /// </summary>
1242 COPY = 0x0301,
1243  
1244 /// <summary>
1245 /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the
1246 /// clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data
1247 /// in CF_TEXT format.
1248 /// </summary>
1249 PASTE = 0x0302,
1250  
1251 /// <summary>
1252 /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if
1253 /// any, from the edit control.
1254 /// </summary>
1255 CLEAR = 0x0303,
1256  
1257 /// <summary>
1258 /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to
1259 /// an edit control, the previously deleted text is restored or the previously added text is deleted.
1260 /// </summary>
1261 UNDO = 0x0304,
1262  
1263 /// <summary>
1264 /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format
1265 /// and if an application has requested data in that format. The clipboard owner must render data in the specified
1266 /// format and place it on the clipboard by calling the SetClipboardData function.
1267 /// </summary>
1268 RENDERFORMAT = 0x0305,
1269  
1270 /// <summary>
1271 /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has
1272 /// delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other
1273 /// applications, the clipboard owner must render data in all the formats it is capable of generating, and place the
1274 /// data on the clipboard by calling the SetClipboardData function.
1275 /// </summary>
1276 RENDERALLFORMATS = 0x0306,
1277  
1278 /// <summary>
1279 /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties
1280 /// the clipboard.
1281 /// </summary>
1282 DESTROYCLIPBOARD = 0x0307,
1283  
1284 /// <summary>
1285 /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the
1286 /// clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
1287 /// </summary>
1288 DRAWCLIPBOARD = 0x0308,
1289  
1290 /// <summary>
1291 /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard
1292 /// contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting.
1293 /// </summary>
1294 PAINTCLIPBOARD = 0x0309,
1295  
1296 /// <summary>
1297 /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard
1298 /// contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The
1299 /// owner should scroll the clipboard image and update the scroll bar values.
1300 /// </summary>
1301 VSCROLLCLIPBOARD = 0x030A,
1302  
1303 /// <summary>
1304 /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard
1305 /// contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size.
1306 /// </summary>
1307 SIZECLIPBOARD = 0x030B,
1308  
1309 /// <summary>
1310 /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a
1311 /// CF_OWNERDISPLAY clipboard format.
1312 /// </summary>
1313 ASKCBFORMATNAME = 0x030C,
1314  
1315 /// <summary>
1316 /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being
1317 /// removed from the chain.
1318 /// </summary>
1319 CHANGECBCHAIN = 0x030D,
1320  
1321 /// <summary>
1322 /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the
1323 /// clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal
1324 /// scroll bar. The owner should scroll the clipboard image and update the scroll bar values.
1325 /// </summary>
1326 HSCROLLCLIPBOARD = 0x030E,
1327  
1328 /// <summary>
1329 /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to
1330 /// realize its logical palette when it receives the focus.
1331 /// </summary>
1332 QUERYNEWPALETTE = 0x030F,
1333  
1334 /// <summary>
1335 /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette.
1336 /// </summary>
1337 PALETTEISCHANGING = 0x0310,
1338  
1339 /// <summary>
1340 /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus
1341 /// realizes its logical palette.
1342 /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their
1343 /// client areas.
1344 /// </summary>
1345 PALETTECHANGED = 0x0311,
1346  
1347 /// <summary>
1348 /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The
1349 /// message is placed at the top of the message queue associated with the thread that registered the hot key.
1350 /// </summary>
1351 HOTKEY = 0x0312,
1352  
1353 /// <summary>
1354 /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most
1355 /// commonly in a printer device context.
1356 /// </summary>
1357 PRINT = 0x0317,
1358  
1359 /// <summary>
1360 /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device
1361 /// context, most commonly in a printer device context.
1362 /// </summary>
1363 PRINTCLIENT = 0x0318,
1364  
1365 /// <summary>
1366 /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by
1367 /// clicking an application command button using the mouse or typing an application command key on the keyboard.
1368 /// </summary>
1369 APPCOMMAND = 0x0319,
1370  
1371 /// <summary>
1372 /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change
1373 /// events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.
1374 /// </summary>
1375 THEMECHANGED = 0x031A,
1376  
1377 /// <summary>
1378 /// Sent when the contents of the clipboard have changed.
1379 /// </summary>
1380 CLIPBOARDUPDATE = 0x031D,
1381  
1382 /// <summary>
1383 /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop
1384 /// composition has changed.
1385 /// </summary>
1386 DWMCOMPOSITIONCHANGED = 0x031E,
1387  
1388 /// <summary>
1389 /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows
1390 /// that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message.
1391 /// </summary>
1392 DWMNCRENDERINGCHANGED = 0x031F,
1393  
1394 /// <summary>
1395 /// Sent to all top-level windows when the colorization color has changed.
1396 /// </summary>
1397 DWMCOLORIZATIONCOLORCHANGED = 0x0320,
1398  
1399 /// <summary>
1400 /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register
1401 /// for this message as well. You'd have other windowd go opaque when this message is sent.
1402 /// </summary>
1403 DWMWINDOWMAXIMIZEDCHANGE = 0x0321,
1404  
1405 /// <summary>
1406 /// Sent to request extended title bar information. A window receives this message through its WindowProc function.
1407 /// </summary>
1408 GETTITLEBARINFOEX = 0x033F,
1409  
1410 HANDHELDFIRST = 0x0358,
1411  
1412 HANDHELDLAST = 0x035F,
1413  
1414 AFXFIRST = 0x0360,
1415  
1416 AFXLAST = 0x037F,
1417  
1418 PENWINFIRST = 0x0380,
1419  
1420 PENWINLAST = 0x038F,
1421  
1422 /// <summary>
1423 /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X
1424 /// is an integer value.
1425 /// </summary>
1426 APP = 0x8000,
1427  
1428 /// <summary>
1429 /// The WM_USER constant is used by applications to help define private messages for use by private window classes,
1430 /// usually of the form WM_USER+X, where X is an integer value.
1431 /// </summary>
1432 USER = 0x0400,
1433  
1434 /// <summary>
1435 /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application
1436 /// be started.
1437 /// </summary>
1438 CPL_LAUNCH = USER + 0x1000,
1439  
1440 /// <summary>
1441 /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has
1442 /// closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH
1443 /// message that started the application.
1444 /// </summary>
1445 CPL_LAUNCHED = USER + 0x1001,
1446  
1447 /// <summary>
1448 /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like
1449 /// scrolling.
1450 /// </summary>
1451 SYSTIMER = 0x118,
1452  
1453 /// <summary>
1454 /// The accessibility state has changed.
1455 /// </summary>
1456 HSHELL_ACCESSIBILITYSTATE = 11,
1457  
1458 /// <summary>
1459 /// The shell should activate its main window.
1460 /// </summary>
1461 HSHELL_ACTIVATESHELLWINDOW = 3,
1462  
1463 /// <summary>
1464 /// The user completed an input event (for example, pressed an application command button on the mouse or an
1465 /// application command key on the keyboard), and the application did not handle the WM_APPCOMMAND message generated by
1466 /// that input.
1467 /// If the Shell procedure handles the WM_COMMAND message, it should not call CallNextHookEx. See the Return Value
1468 /// section for more information.
1469 /// </summary>
1470 HSHELL_APPCOMMAND = 12,
1471  
1472 /// <summary>
1473 /// A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the
1474 /// window.
1475 /// </summary>
1476 HSHELL_GETMINRECT = 5,
1477  
1478 /// <summary>
1479 /// Keyboard language was changed or a new keyboard layout was loaded.
1480 /// </summary>
1481 HSHELL_LANGUAGE = 8,
1482  
1483 /// <summary>
1484 /// The title of a window in the task bar has been redrawn.
1485 /// </summary>
1486 HSHELL_REDRAW = 6,
1487  
1488 /// <summary>
1489 /// The user has selected the task list. A shell application that provides a task list should return TRUE to prevent
1490 /// Windows from starting its task list.
1491 /// </summary>
1492 HSHELL_TASKMAN = 7,
1493  
1494 /// <summary>
1495 /// A top-level, unowned window has been created. The window exists when the system calls this hook.
1496 /// </summary>
1497 HSHELL_WINDOWCREATED = 1,
1498  
1499 /// <summary>
1500 /// A top-level, unowned window is about to be destroyed. The window still exists when the system calls this hook.
1501 /// </summary>
1502 HSHELL_WINDOWDESTROYED = 2,
1503  
1504 /// <summary>
1505 /// The activation has changed to a different top-level, unowned window.
1506 /// </summary>
1507 HSHELL_WINDOWACTIVATED = 4,
1508  
1509 /// <summary>
1510 /// A top-level window is being replaced. The window exists when the system calls this hook.
1511 /// </summary>
1512 HSHELL_WINDOWREPLACED = 13
1513 }
1514  
1515 #endregion
1516  
1517 #region Public Methods
1518  
1519 [DllImport("User32.dll")]
1520 public static extern IntPtr CallNextHookEx(
1521 IntPtr hHook, int nCode, IntPtr wParam, IntPtr lParam);
1522  
1523 [DllImport("User32.dll")]
1524 public static extern IntPtr UnhookWindowsHookEx(IntPtr hHook);
1525  
1526  
1527 [DllImport("User32.dll")]
1528 public static extern IntPtr SetWindowsHookEx(
1529 int idHook, HookDelegate lpfn, IntPtr hmod,
1530 int dwThreadId);
1531  
1532 /// <summary>
1533 /// Retrieves the cursor's position, in screen coordinates.
1534 /// </summary>
1535 /// <see>See MSDN documentation for further information.</see>
1536 [DllImport("user32.dll")]
1537 public static extern bool GetCursorPos(out POINT lpPoint);
1538  
1539 public static Point GetCursorPosition()
1540 {
1541 POINT lpPoint;
1542 GetCursorPos(out lpPoint);
1543 // NOTE: If you need error handling
1544 // bool success = GetCursorPos(out lpPoint);
1545 // if (!success)
1546  
1547 return lpPoint;
1548 }
1549  
1550 #endregion
1551  
1552 #region Nested Types
1553  
1554 /// <summary>
1555 /// Struct representing a point.
1556 /// </summary>
1557 [StructLayout(LayoutKind.Sequential)]
1558 public struct POINT
1559 {
1560 public int X;
1561  
1562 public int Y;
1563  
1564 public static implicit operator Point(POINT point)
1565 {
1566 return new Point(point.X, point.Y);
1567 }
1568 }
1569  
1570 #endregion
1571 }
1572 }