One. MSDN description
Message structure
See
Message Member | System.Windows.Forms Namespace | Message Member (Visual J # Syntax) | C Hosting Extension Programming
Claim
Name Space: System.Windows.Forms
Platform: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 Series
AGM: System.Windows.Forms (in System.Windows.Forms.dll)
Language
C #
C
JScript
Visual Basic
All display
Implement Windows messages.
For a list of all members of this type, see the Message member.
System.Object System.ValeType System.Windows.Forms.Message
[Visual Basic]
Public structure message
[C #]
Public struct message
[C ]
Public __Value struct message
[JScript] In JScript, you can use the structure in .NET Framework, but you cannot define your own structure.
Thread security
All public static (Visual Basic) members are safe for multithreading operations. But not to ensure that any instance member is thread safe.
Note
Message Structure Packaging Windows Send Message. This structural package can be used and assigned to the window process for scheduling. This structure can also be used to obtain information about a message to an application or control to an application or control.
You can't create a Message structure directly. To create a Message structure, use the Create method. In order to create a Message structure more effectively, the Message structure will use its existing Message structural pool in the case, rather than instantification. However, if there is no Message structure in the pool, a new structure will be instantiated.
Message member
Public property
HWnd
Get or set the window handle of the message.
Lparam
Specifies the LPARAM field of the message.
MSG
Gets or sets the ID number of the message.
Result
Specifies the value returned to Windows to the response message processing.
WPARAM
Get or set the WPARAM field for the message.
Public approach
Create
Create a new Message structure.
Equals
Override. See ValueType.equals.
Gethashcode
Override. See ValueType.gethashcode.
Getlparam
Get the lparam value and convert the value to an object.
GetType (inherited from Object)
Get the current instance of TYPE.
Tostring
Override. See ValueType.toString.
Protected method
Finalize (inherited from Object)
Override. Allow Object to try to release resources and perform other cleaning operations before "garbage recycling" recycle Object.
In C # and C , the terminator is used to represent the termination program.
MEMBERWISECLONE (inherited from Object)
Create a shallow copy of the current Object.
Second, the message list
[Message] means a notification issued by Windows to tell the application something happens. For example, click the mouse, change the window size, press a key on the keyboard to send Windows to your application. The message itself is passed to the application as a record, and this record contains the type of message and other information. For example, for messages generated by clicking on the mouse, this record contains the coordinates when clicking the mouse. This record type is called TMSG, which is declared in the Windows unit:
Type
TMSG = Packed Record
HWnd: hwnd; / / window handle
Message: UINT; / / message constant identifier
WPARAM: WPARAM; / / 32-bit message Specific additional information
LPARAM: LPARAM; / / 32-bit message Specific additional information
Time: DWORD; / / message is created
PT: TPOINT; / / Message Mouse Location
END;
What is there in the news?
Do you feel that the information in a message record is like Greek? If so, then take a look at the explanation below:
HWND 32-bit window handle. The window can be any type of screen object because Win32 is able to maintain the handle of most visual objects (windows, dialogs, buttons, edit boxes, etc.).
Message is used to distinguish constant values for other messages, which may be predefined in the Windows unit, or they can be custom constants.
WPARAM is usually a constant value related to messages or a handle of a window or control.
LPARAM is usually a pointer to data in memory. Since W p A r a m, L P A R A M and P O i n t E r are 3 2 bits,
Therefore, they can be converted between them.
WM_NULL = 0000;
WM_CREATE = $ 0001;
Application creates a window
WM_DESTROY = $ 0002;
One window is destroyed
WM_MOVE = $ 0003;
Move a window
WM_SIZE = $ 0005;
Change the size of a window
WM_ACTIVATE = $ 0006;
A window is activated or lost to activate;
WM_SETFOCUS = $ 0007;
After getting the focus
WM_KILLFOCUS = $ 0008;
lose focus
WM_ENABLE = $ 000A;
Change the Enable status
WM_SETREDRAW = $ 000B;
Set whether the window is able to redraw
WM_SETTEXT = $ 000c;
The application sends this message to set the text of a window
WM_GETTEXT = $ 000d;
The application sends this message to copy the text to the buffer corresponding to the window
WM_GETTEXTLENGTH = $ 000E;
Get the length of text related to a window (not including empty characters)
WM_PAINT = $ 000F;
Ask one window to call yourself
WM_CLOSE = $ 0010;
Send a signal when a window or application is turned off
WM_QUERYENDSESSION = $ 0011;
When the user selects the end dialog or the program calls the exitwindows function
WM_QUIT = $ 0012;
Used to end the program to run or when the program calls postquitMessage functions
WM_QUERYOPEN = $ 0013;
When the user window recovers the previous size position, send this message to an icon.
WM_ERASEBKGND = $ 0014;
When the window background must be erased (case change in the window)
WM_SYSCOLORCHANGE = $ 0015;
When the system color changes, send this message to all top windows
WM_ENDSESSION = $ 0016; After the system process issues a WM_QueryEndSession message, this message is sent to the application.
Notify it to end if the conversation ends
WM_SYSTEMERROR = $ 0017;
WM_SHOWINDOW = $ 0018;
When the hidden or display window is sent to this message to this window
WM_ACTIVATEAPP = $ 001C;
Send this message Which window is activated, which is an inactive;
WM_FONTCHANGE = $ 001d;
Send this message to all top windows when the system's font resource library changes
WM_TIMECHANGE = $ 001E;
Send this message to all top windows when the system's time changes
WM_CANCELMODE = $ 001F;
Send this message to cancel some of the ongoing touch state (operation)
WM_SETCURSOR = $ 0020;
If the mouse causes the cursor to move in a window and the mouse input is not captured, send a message to a window.
WM_MOUSEAACTIVATE = $ 0021;
When the cursor is in a non-active window and the user is in pressing a key in the mouse to send this message to the current window.
WM_CHILDACTIVATE = $ 0022;
Send this message to the MDI child window When the user clicks on this window, or when the window is activated, moved, change the size
WM_QUEESYNC = $ 0023;
This message is sent by the computer-based training program, through the HOOK program of WH_Journalpalyback
Separate user input message
WM_GETMINMAXINFO = $ 0024;
This message is sent to the window When it will change the size or position;
WM_PaintICON = $ 0026;
Send to the minimization window When it icon will be heavy
WM_ICONERASEBKGND = $ 0027;
This message is sent to a minimization window, only when it is drawing the background, it must be heavy
WM_NEXTDLGCTL = $ 0028;
Send this message to a dialog program to change the focus location
WM_SPOOLERSTATUS = $ 002A;
Whenever the print management queue increases or decreases this message when a job
WM_DRAWITEM = $ 002B;
Send when button, ComboBox, ListBox, Menu visual appearance changes
This message gives the owner of these empty parts
WM_MEASUREITEM = $ 002c;
When Button, Combo Box, List Box, List View Control, or Menu Item is created
Send this message to the owner of the control
WM_DELETEITEM = $ 002d;
When the List Box or Combo Box is destroyed or when some items are removed through lb_deleteString, lb_resetcontent, cb_deleteString, or cb_resetcontent message
WM_VKEYTOITEM = $ 002E;
This message has a LBS_WANTKEYBOARDINPUT style to the owner of it to respond to WM_KeyDown messages
WM_CHARTOITEM = $ 002F;
This message is sent to his owner by a list box in a lbs_wantkeyboardinput style to respond to WM_CHAR messages.
WM_SETFONT = $ 0030;
When the text is drawn, the program is sent this message to get the color you want to use.
WM_GETFONT = $ 0031;
Application Send this message to get the current control to draw the text
WM_SETHOTKEY = $ 0032;
The application sends this message to let a window associated with a hotkey
WM_GETHOTKEY = $ 0033;
The application sends this message to determine if the hotkey is associated with a window.
WM_QueryDragicon = $ 0037; This message is sent to the minimization window, when this window will be drag and drop, it is not defined in its class, the application can return an icon or cursor handle, when the user drag and drop the icon, the system displays this icon or cursor
WM_CompareItem = $ 0039;
Send this message to determine the relative position of the new item added in ComboBox or Listbox
WM_GETOBJECT = $ 003D;
WM_Compacting = $ 0041;
There is already very few memory
WM_WINDOWPOSCHANGINGING = 0046;
Send this message to call the SETWINDOWPOS function or other window management functions when the size and location of the window will be changed.
WM_WINDOWPOSCHANGED = $ 0047;
Send this message to call the SETWINDOWPOS function or other window management functions when the size and location of the window have been changed.
WM_POWER = $ 0048; (for 16-bit Windows)
This message will be sent when the system will enter the pause state
WM_COPYDATA = $ 004A;
Send this message when an application passes data to another application
WM_CANCELJNAL = $ 004B;
Submit this message to the program when a user cancels the program log activation status
WM_NOTIFY = $ 004E;
When a control is or if this control needs to get some information, send this message to its parent window.
WM_INPUTLANGCHANGEREQUEST = $ 0050;
When the user selects some kind of input language, or the hotkey change in the input language
WM_INPUTLANGCHANGE = $ 0051;
This message is sent to the most affected top window when the platform has been changed.
WM_TCARD = $ 0052;
This message is sent to the application when the program has initialized the Windows Help routine.
WM_HELP = $ 0053;
This message shows that the user presses F1. If a menu is activated, send this message and this window is associated with the menu, otherwise
Send to a focus window, if there is no focus, you send this message to the currently activated window.
WM_USERCHANGED = $ 0054;
When the user has already logged in or exits, this message is sent to all windows, and the system updates the user's specific user when the user logs in or exits.
Setting information, send this message immediately when the user update settings;
WM_NOTIFYFORMAT = $ 0055;
Public controls, custom controls and their parent windows to determine that the control is using ANSI or Unicode structure
In the WM_NOTIFY message, use this control to communicate with each control with its parent controls
WM_CONTEXTMENU = $ 007B;
When you click on a window, you can send this message to this window.
WM_StyleChanging = $ 007c;
When the calling setWindowlong function will change this message to that window when you want to change the style of one or more windows.
WM_Stylechanged = $ 007D;
This message is sent to that window when calling the style of a setWindowlong function one or more windows.
WM_DISPLAYCHANGE = $ 007E;
Send this message to all windows when the resolution of the display changes
WM_GETICON = $ 007F;
This message is sent to a window to return a handle of a large icon or a small icon with a window;
WM_seticon = 0080;
The program sends this message to let a new large icon or small icon associated with a window;
WM_NCCREATE = $ 0081;
This message is sent before the WM_CREATE message is sent when a window is created first.
WM_NCDESTROY = $ 0082; This message notifies a window, non-customer area is destroying
WM_NCCALCSIZE = $ 0083;
This message must be sent when a customer area of a window must be verified
WM_NCHITTEST = $ 0084; // Move the mouse, hold down or release the mouse
WM_NCPAINT = $ 0085;
The program sends this message to a window when it (window) is drawn;
WM_NCActivate = $ 0086;
This message is sent to a window only when its non-customer area needs to be changed to display is activated or inactive;
WM_GETDLGCODE = $ 0087;
Send this message to a control associated with a dialog program, Widdows Control orientation key, and Tab keys make input into this control
By responding to the WM_GETDLGCODE message, the application can treat him as a special input control and can handle it.
WM_NCMOUSEMOVE = $ 00A0;
When the cursor moves this message to this message to this window // Non-customer area: the title bar and window of the form
Bench
WM_NCLBUTTONDOWN = $ 00A1;
This message submits this message when the cursor is in the non-client area of a window.
WM_NCLBUTTONUP = $ 00A2;
When the user releases the left mouse button, the cursor is sent to the non-client zone ten;
WM_NCLBUTTONDBLCLK = $ 00A3;
When the user doubles the left mouse button, the spectrum is sent to this message in the non-client zone ten.
WM_ncrbuttondown = $ 00A4;
When the user presses the mouse button, the cursor is sent to this message when the cursor is in the non-client district of the window.
WM_NCRBUTTONUP = $ 00A5;
When the user releases the right mouse button, the cursor is sent to the window's non-client district.
WM_ncrbuttondblClk = $ 00A6;
When the user doubles the mouse button, the cursor is sent in the non-client zone ten.
WM_NCMBUTTONDOWN = $ 00A7;
When the user presses the mouse button while the cursor is also sent this message when the cursor is in the non-client district of the window.
WM_NCMBUTTONUP = $ 00A8;
When the user releases the mouse button while the cursor is also sent to the window's non-client district
WM_NCMBUTTONDBLCLK = $ 00A9;
When the user doubles the mouse button, the cursor is sent to this message when the cursor is in the non-client district of the window.
WM_KEYFIRST = $ 0100;
WM_KEYDOWN = $ 0100;
// Press a key
WM_KEYUP = $ 0101;
/ / Release a key
WM_CHAR = $ 0102;
/ / Press a key and have issued WM_KEYDOWN, WM_KEYUP message
WM_deadchar = $ 0103;
Send this message to the window with focus when translating the WM_KEYUP message with the TranslateMessage function
WM_SYSKEYDOWN = $ 0104;
Submit this message to the window with focus when the user holds down the Alt button.
WM_SYSKEYUP = $ 0105;
When the user releases a button while the Alt key is pressed, submit this message to the window with focus.
WM_SYSCHAR = $ 0106;
When the WM_SYSKEYDOWN message is translated by the translateMessage function, submit this message to the window with focus.
WM_SYSDEADCHAR = $ 0107;
When the WM_SYSKEYDOWN message is translated by the translateMessage function, send this message to the window with focus.
WM_KEYLAST = $ 0108;
WM_INITDIALOG = $ 0110;
Send this message before a dialog program is displayed, usually use this message to initialize the control and perform other tasks.
WM_COMMAND = $ 0111;
When the user selects a menu command item or when a control sends a message to its parent window, a shortcut is translated by w_syscommand = $ 0112;
When a user selects a command to the window menu or when the user selects maximizes or minimizes the message, the window will receive this message.
WM_TIMER = $ 0113; // The timer event has occurred
WM_HSCROLL = $ 0114;
When a window standard horizontal scroll bar generates a scrolling event to send this message to that window, also sent to the control with it
WM_VSCROLL = $ 0115;
When a window standard vertical scroll bar generates a scrolling event to send this message to that window, send it to the control WM_INITMENU = $ 0116;
When a menu will be activated, this message is sent, which occurs in a user menu bar or presses a menu button, which allows the program to change the menu before display
WM_INITMENUPOPUP = $ 0117;
When a drop-down menu or submenu will be sent to send this message when it is activated, it allows the program to change the menu before it is displayed, not to change all
WM_MENUSELECT = $ 011f;
When the user selects a menu item, send this message to the owner of the menu (generally the window)
WM_MENUCHAR = $ 0120;
When the menu has been activated by the user (different from the accelerator), send this message to the owner of the menu;
WM_ENTERIDLE = $ 0121;
When a modal dialog or menu enters an air-loaded state, send this message to its owner, a modal dialog or menu into the no-load state is the column that does not have a message after processing one or more previous messages. Neutralize
WM_MENURBUTTONUP = $ 0122;
WM_MENUDRAG = $ 0123;
WM_MENUGETOBJECT = $ 0124;
WM_UNINITMENUPOPUP = $ 0125;
WM_MENUCOMMAND = $ 0126;
WM_CHANGEUISTATE = $ 0127;
WM_UPDATEUISTATE = $ 0128;
WM_QUERYUISTATE = $ 0129;
WM_CTLCOLORMSGBOX = $ 0132;
Send this message to the owner window of the message box before drawing the message box, by responding to this message, the owner window can set the text and background color of the message box with the handle of the given related display device.
WM_CTLCOLOREDIT = $ 0133;
When a editing control will be drawn, send this message to its parent window; by responding to this message, the owner window can set the text and background color of the edit box by using the handle of the given related display device.
WM_CTLCOLORLISTBOX = $ 0134;
When a list box control will send this message to its parent window before being drawn; by responding to this message, the owner window can set the text and background color of the list box by using the handle of the given related display device.
WM_CTLCOLORBTN = $ 0135;
When a button control will send this message to its parent window; by responding to this message, the owner window can set the text and background color of the button with the handle of the given related display device.
WM_CTLCOLORDLG = $ 0136;
When a dialog control will send this message to the parent window before drawn; by responding to this message, the owner window can set the text background color of the dialog box by using the handle of the given related display device.
WM_CTLCOLORSCROLLBAR = $ 0137;
When a scroll strip control will send this message to its parent window; by responding to this message, the owner window can set the background color of the scroll bar by using the handle of the given related display device.
WM_CTLCOLORSTATIC = $ 0138;
When a static control will be drawn, send this message to its parent window; by responding to this message, the owner window can set the text and background color WM_Mousefirst = $ 0200 of the static control by using the handle of a given related display device;
WM_MOUSEMOVE = $ 0200;
// Move mouse
// Move mouse
WM_LBUTTONDOWN = $ 0201;
// Press the left mouse button
WM_LBUTTONUP = $ 0202;
// Release the left mouse button
WM_LBUTTONDBLCLK = $ 0203;
/ / Double-click the left mouse button
WM_RBUTTONDOWN = $ 0204;
// Press the right mouse button
WM_RBUTTONUP = $ 0205;
// Release the right mouse button
WM_RBUTTONDBLCLK = $ 0206;
/ / Double-click the mouse button
WM_MBUTTONDOWN = $ 0207;
// Press the mouse button
WM_MBUTTONUP = $ 0208;
/ / Release the mouse button
WM_MBUTTONDBLCLK = $ 0209;
/ / Double click on the mouse button
WM_MOUSEWHEEL = $ 020A;
Send this message when the mouse wheel is rotated, the current focus control
WM_MouseLaseT = $ 020A;
WM_ParentNotify = $ 0210;
When the MDI sub-window is created or destroyed, or the user presses the mouse button and the cursor will send this message to its parent window on the child window.
WM_ENTERMENULOOP = $ 0211;
Send this message to notify the application's main window That has entered the menu loop mode
WM_EXITMENULOOP = $ 0212;
Send this message to notify the application's main window That has exited menu loop mode
WM_NEXTMENU = $ 0213;
WM_SIZING = 532;
When the user is adjusting the window size to the window; you can monitor the window size and location through this message application can also modify them.
WM_CAPTURECHANGED = 533;
Send this message to the window When it lost the captured mouse;
WM_MOVING = 534;
When the user sends this message while moving the window, you can monitor the window size and location or modify them;
WM_PowerBroadcast = 536;
This message is sent to the application to inform it about power management events;
WM_DEVICECHANGE = 537;
This message is sent to the application or device driver when the hardware configuration change of the device changes
WM_IME_STARTCOMPSION = $ 010d;
WM_IME_ENDComposition = $ 010e;
WM_IME_COMPSITION = $ 010f;
WM_IME_KEYLAST = $ 010F;
WM_IME_SETCONTEXT = $ 0281;
WM_IME_NOTIFY = $ 0282;
WM_IME_CONTROL = $ 0283;
WM_IME_COMPSITIONFULL = $ 0284;
WM_IME_SELECT = $ 0285;
WM_IME_CHAR = $ 0286;
WM_IME_REQUEST = $ 0288;
WM_IME_KEYDOWN = $ 0290;
WM_IME_KEYUP = $ 0291;
WM_MDicReate = $ 0220;
The application sends this message to a multi-document customer window to create an MDI sub-window
WM_MDIDESTROY = $ 0221;
The application sends this message to the multi-document customer window to close a MDI sub-window
WM_MDIACTIVATE = $ 0222;
The application sends this message to the multi-document customer window to activate another MDI sub-window, after the customer window receives this message, it issues a WM_MDIACTIVE message to the MDI sub-window (not activated) activated it; WM_MDIRESTORE = $ 0223;
The program sends this message to the MDI customer window to restore the sub-window from the maximum minimization to the original size
WM_MDINEXT = $ 0224;
Program Send this message to the MDI customer window to activate the next or the previous window
WM_MDIMAXIMIZE = $ 0225;
The program sends this message to the MDI client window to maximize an MDI sub-window;
WM_MDITILE = $ 0226;
The program sends this message to the MDI customer window to rearrange all MDI sub-windows
WM_MDICASCADE = $ 0227;
The program sends this message to the MDI customer window to replace all MDI sub-windows in a laminated manner
WM_MDIICONARRANGE = $ 0228;
The program sends this message to rearrange all minimized MDI sub-windows to the MDI client window.
WM_MDIGETACTIVE = $ 0229;
The program sends this message to the MDI client window to find the handle of the activated sub-window
WM_MDisetMenu = $ 0230;
The program sends this message to the MDI customer window instead of the menu of the sub-window
WM_ENTERSIZEMOVE = $ 0231;
WM_EXITSIZEMOVE = $ 0232;
WM_DROPFILES = $ 0233;
WM_MDIREFRESHMENU = $ 0234;
WM_Mousehover = $ 02A1;
WM_MouseLeave = $ 02A3;
WM_CUT = $ 0300;
The program sends this message to an edit box or ComboBox to delete the currently selected text
WM_copy = $ 0301;
The program sends this message to a edit box or ComboBox to copy the currently selected text to the clipboard
WM_PASTE = $ 0302;
Program Send this message to EditControl or ComboBox gets data from the clipboard
WM_CLEAR = $ 0303;
The program sends this message to EDITCONTROL or COMBOBOX to clear the currently selected content;
WM_UNDO = $ 0304;
Program Send this message to EditControl or ComboBox to undo the last operation
WM_RENDERFORMAT = $ 0305;
WM_RENDERLFORMATS = $ 0306;
WM_DESTROYCLIPBOARD = $ 0307;
Send this message to the owner of the clipboard when calling an EnPtyClipboard function
WM_DRAWCLIPBOARD = $ 0308;
When the content changes of the clipboard, this message is sent to the first window of the clipboard to observe the chain; it allows the window to observe the window
Display new content of the clipboard;
WM_PaintClipboard = $ 0309;
When the clipboard contains data in the CF_OWNERDIPLAY format and the clipboard observed the window of the window needs to be heavy;
WM_VSCROLLLPBOARD = $ 030A;
WM_SIZECLIPBOARD = $ 030B;
When the clipboard contains data in the CF_OWNERDIPLAY format and the size of the clipboard observation window has changed that this message is sent to the owner of the clipboard by the clipboard observation window;
WM_ASKCBFORMATNAME = $ 030c;
Send this message to the owner of the clipboard to request a clipboard name of the clipboard with the owner of the clipboard through the clipboard observation window.
WM_CHANGECBCHAIN = $ 030D;
This message is sent to the first window of the clipboard when the window is removed from the clipboard observation chain.
WM_HSCROLLLLIPBOARD = $ 030E; This message is sent to the owner of the clipboard through a clipboard watch window; it occurs when the clipboard contains data in the CFOWNERDISPALY format and has an event on the horizontal scroll bar of the clipboard viewing window; owner should Scroll the clipboard image and update the value of the scroll bar;
WM_QUERYNEWPALETTE = $ 030F;
This message is sent to a window that will receive a focus. This message enables the window to have the opportunity to achieve his logical palette while receiving the focus.
WM_PALETTEISCHANGINGINGINGING = $ 0310;
When an application is to implement its logical palette, this message notifies all applications
WM_PALETTECHANGED = $ 0311;
This message is sent to all top-level and overlapping windows after implementing its logical palette on a focus window. To change the system palette.
WM_HOTKEY = $ 0312;
This message is submitted when the user presses the hotkey registered by the RegisterhotKey function.
WM_PRINT = 791;
Application Send This message is only part of the application only when Windows or other applications issues a request request;
WM_PRINTCLIENT = 792;
WM_HANDHELDFIRST = 856;
WM_HANDHELDLAST = 863;
WM_PENWINFIRST = $ 0380;
WM_PENWINLAST = $ 038F;
WM_COALESCE_FIRST = $ 0390;
WM_COALESCE_LAST = $ 039F;
WM_DDE_FIRST = $ 03E0;
WM_DDE_INITIATE = WM_DDE_FIRST 0;
A DDE client submits this message to start a session with the server to respond to the specified program and theme name;
WM_DDE_TERMINATE = WM_DDE_FIRST 1;
A DDE application (whether a customer or server) submits this message to terminate a session;
WM_DDE_ADVISE = WM_DDE_FIRST 2;
A DDE client submits this message to a DDE service program to request the server to update it whenever the data item changes
WM_DDE_UNADVISE = WM_DDE_FIRST 3;
A DDE client notifies a DDE service that does not update the specified item or a special clipboard format.
WM_DDE_ACK = WM_DDE_FIRST 4;
This message notifies a DDE (Dynamic Data Exchange) program has received and is processed WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIAT message
WM_DDE_DATA = WM_DDE_FIRST 5;
A DDE service program submits this message to the DDE client to deliver a data item to the customer or notify the customer.
WM_DDE_REQUEST = WM_DDE_FIRST 6;
A DDE client submits this message to a DDE service program to request a value of a data item;
WM_DDE_POKE = WM_DDE_FIRST 7;
A DDE client submits this message to a DDE service program, the customer uses this message to request the server to receive an unadcoming data item; the server passes whether the WM_DDE_ACK message prompts whether it receives this data item;
WM_DDE_EXECUTE = WM_DDE_FIRST 8;
A DDE client submits this message to a DDE service program to send a string to the server to let it be in the serial command, the server responds by submitting the WM_DDE_ACK message; WM_DDE_LAST = WM_DDE_FIRST 8;
WM_APP = $ 8000;
WM_USER = $ 0400;
This message helps application custom private messages;
Third, example
Example 1, arbitrary drag the form
Using system;
Using system.drawing;
Using system.collections;
Using system.componentmodel;
Using system.windows.forms;
Using system.Runtime.InteropServices;
Using system.data;
Namespace WindowsApplication1
{
///
/// Form1 summary description.
/// summary>
Public Class Form1: System.Windows.Forms.form
{
Private const INT WM_NCHITTEST = 0x84;
Private const Int htclient = 0x1;
Private const Int htsize = 0x4;
Private const Int htcaption = 0x2;
Private const Int wm_sizing = 532;
Private const Int htminButton = 8;
Private int margin = 5;
Private system.windows.Forms.Button button1;
///
/// The required designer variable.
/// summary>
Private system.componentmodel.Container Components = NULL;
Public Form1 ()
{
//
// Windows Form Designer Support
//
InitializationComponent ();
//
// Todo: Add any constructor code after INITIALIZECOMPONENT call
//
}
///
/// Clean all the resources being used.
/// summary>
Protected Override Void Dispose (Bool Disposing)
{
IF (Disposing)
{
IF (Components! = NULL)
{
Components.dispose ();
}
}
Base.dispose (Disposing);
}
#Region Windows Form Designer Generated Code
///
/// Designer supports the required method - do not use the code editor to modify
/// This method is content.
/// summary>
Private vidinitiRizeComponent ()
{
This.button1 = new system.windows.Forms.Button ();
THIS.SUSPENDLAYOUT ();
//
// Button1
//
This.button1.location = new system.drawing.point (119, 122);
This.button1.name = "button1";
This.button1.tabindex = 1;
This.Button1.text = "Close"; this.button1.click = new system.eventhandler (this.button1_click);
//
// Form1
//
THIS.AUTOSCALEBASESIZE = New System.drawing.size (6, 14);
THIS.CLIENTSIZE = New System.drawing.size (312, 266);
THIS.CONTROLBOX = FALSE;
This.Controls.add (this.button1);
This.FormBorderstyle = system.windows.forms.formorderstyle.none;
THIS.MAXIMIZEBOX = FALSE;
THIS.MINIMIZEBOX = FALSE;
THIS.NAME = "Form1";
THIS.TEXT = "Test";
This.Leave = new system.eventhandler (this.form1_mouseelease);
THIS.Enter = new system.eventhandler (this.form1_mouseenter);
This.ResumeLayout (false);
}
#ndregion
///
/// The main entry point for the application.
/// summary>
[Stathread]
Static void
Main
()
{
Application.run (New Form1 ());
}
Private void Button1_Click (Object Sender, System.Eventargs E)
{
THIS.CLOSE ();
}
Private void button3_click (Object Sender, System.Eventargs E)
{
}
Private void button2_click_1 (Object Sender, System.EventArgs E)
{
}
Private Void Form1_MouseLeave (Object Sender, System.EventArgs E)
{
}
Private Void Form1_MouseEnter (Object Sender, System.EventArgs E)
{
}
Protected Override Void WndProc (Ref Message M)
{
Switch (m.msg)
{
Case WM_NCHITTEST:
Base.WndProc (Ref M);
IF ((int) m.Result == htclient)
IF ((Cursor.Position.x <= this.Left Margin) && (Cursor.Position.Y <= this.top margin))
m.Result = (intptr) 13; // top left
Else IF ((Cursor.Position.x> = this.left this.width-margin) && (cursor.position.y <= this.top margin))
m.Result = (intptr) 14; // upper right
Else IF ((Cursor.Position.x <= this.left margin) && (cursor.position.y> = this.top this.Height-margin) m.Result = (intptr) 16; // left
Else IF ((Cursor.Position.x> = this.left this.width-margin) && (cursor.position.y> = this.top this.height-margin)))
m.Result = (intptr) 17; // Right
Else IF (Cursor.Position.x <= this.left margin)
m.Result = (intptr) 10; // left
Else if (Cursor.Position.x> = this.Leste this.width-margin)
m.Result = (intptr) 11; // right
Else if (Cursor.Position.Y <= this.top margin)
m.Result = (intptr) 12; //
Else if (Cursor.Position.Y> = this.top this.height-margin)
m.Result = (intptr) 15; //
Else
m.Result = (intptr) htcaption; // Mobile form
Return;
DEFAULT:
Base.WndProc (Ref M);
Break;
}
}
}
}
Example 2, whether the test program is running normally
Using system;
Using system.drawing;
Using system.windows.forms;
Namespace CSTEMPWINDOWSAPPLICATION1
{
Public Class Form1: System.Windows.Forms.form
{
// Constant Value Was Found in The "Windows.h" Header File.
PRIVATE CONST INT WM_ACTIVATEAPP = 0x001c;
PRIVATE BOOL AppActive = True;
[Stathread]
Static void
Main
()
{
Application.run (New Form1 ());
}
Public Form1 ()
{
This.size = new system.drawing.size (300, 300);
THIS.TEXT = "Form1";
This.font = New System.drawing.Font ("Microsoft Sans Serif", 18F, System.drawing.FontStyle.bold, System.drawing.graphicsUnit.Point, ((System.byte) (0))))
}
Protected Override Void Onpaint (Painteventargs E)
{
// Paint A String in Different Styles Depending on WHETHER T
// Application is Active.
IF (appactive)
{
E.Graphics.FillRectangle (Systembrushes.ActiveCaption, 20, 20, 260, 50);
E.Graphics.drawstring ("Application IS Active", this.font, Systembrushes.ActiveCaptionText, 20, 20);
Else
{
E.Graphics.FillRectangle (Systembrushes.inactiveCaption, 20, 20, 260, 50);
E.Graphics.drawstring ("Application IS Inactive", this.Font, Systembrushes.ActiveCAptionText, 20, 20);
}
}
[System.Security.Permissions.PermissionSt (System.Security.Permissions.SecurityAction.Demand, Name = "fulltrust")]
Protected Override Void WndProc (Ref Message M)
{
// Listen for operation system message.
Switch (m.msg)
{
// the WM_ActivateApp Message Occurs When THE APPLICATION
// becomes the Active Application Or Becomes Inactive.
Case WM_ActivateApp:
// The wparam value Identifies What is iocurring.
AppActive = ((int) m.wparam! = 0));
// invalidate to get new text painted.
THIS.INVALIDATE ();
Break;
}
Base.WndProc (Ref M);
}
}
}
three,
When you click "X" or "Alt F4", minimize windows, such as protected override void wndproc (ref Message M) {const Int wm_syscommand = 0x0112; const INT sc_close = 0xF060; if (M.MSG == WM_SYSCOMMAND &&) INT) m.wparam == sc_close) {// user copy close button.windowState = formwindowState.minimized; return;} Base.WndProc (REF M);}
Fourth, resources
PB Message Daquan Download: http://www.jlsc999.com/pbMessage.exe