Widow – Blame information for rev 14

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