C # SendMessage WPARAM (Collection)

Source: Internet
Author: User
C # SendMessage WPARAM

Public sealed class API
{
// Constant value of the wMsg parameter:
// Press the next key for WM_KEYDOWN
Public static int WM_KEYDOWN = 0x0100;
// Release a key
Public static int WM_KEYUP = 0x0101;
// Press a key and the WM_KEYDOWN and WM_KEYUP messages have been sent.
Public static int WM_CHAR = 0x102;
// Send the message to the window with focus when you use the translatemessage function to translate the WM_KEYUP message
Public static int WM_DEADCHAR = 0x103;
// When you press the ALT key and other keys, submit the message to the window with focus
Public static int WM_SYSKEYDOWN = 0x104;
// When you release a key and press the ALT key, submit the message to the window with focus
Public static int WM_SYSKEYUP = 0x105;
// When the WM_SYSKEYDOWN message is translated by the TRANSLATEMESSAGE function, submit the message to the window with focus
Public static int WM_SYSCHAR = 0x106;
// When the WM_SYSKEYDOWN message is translated by the TRANSLATEMESSAGE function, send this message to the window with focus
Public static int WM_SYSDEADCHAR = 0x107;
// Send this message to a dialog box program before it is displayed. This message is usually used to initialize the control and execute other tasks.
Public static int WM_INITDIALOG = 0x110;
// When you select a menu command item or when a control sends a message to its parent window, a shortcut key is translated
Public static int WM_COMMAND = 0x111;
// When the user selects a command in the window menu or // when the user selects maximize or minimize, the window will receive this message
Public static int WM_SYSCOMMAND = 0x112;
// A timer event occurs.
Public static int WM_TIMER = 0x113;
// When a standard horizontal scroll bar of a window generates a rolling event, this message is sent to that window and the control that owns it.
Public static int WM_HSCROLL = 0x114;
// When a standard vertical scroll bar of a window generates a rolling event, this message is sent to that window and the control that owns it.
Public static int WM_VSCROLL = 0x115;
// Send this message when a menu is to be activated. It occurs in a user menu bar or presses a menu key, which allows the program to change the menu before display.
Public static int WM_INITMENU = 0x116;
// Send this message when a drop-down menu or sub-menu is to be activated. It allows the program to change the menu before it is displayed, instead of changing all
Public static int WM_INITMENUPOPUP = 0x117;
// Send this message to the menu owner (usually a window) when a menu item is selected)
Public static int WM_MENUSELECT = 0x11F;
// When the menu has been activated, the user presses a key (different from the acceleration key) and sends this message to the menu owner
Public static int WM_MENUCHAR = 0x120;
// Send this message to its owner when a modal dialog box or menu enters the idle state, when a modal dialog box or menu enters the no-load status, it waits for no messages in the queue after processing one or more previous messages.
Public static int WM_ENTERIDLE = 0x121;
// Send the message to the owner window of the message box before drawing a message box in windows, in the owner window, you can set the text and background color of the message box by using the given handle of the display device.
Public static int WM_CTLCOLORMSGBOX = 0x132;
// Send this message to its parent window when an edit control is to be drawn, in the owner window, you can set the text and background color of the edit box by using the given handle of the display device.
Public static int WM_CTLCOLOREDIT = 0x133;

// When a list box control sends this message to its parent window before being drawn, it responds to this message, in the owner window, you can set the text and background colors of the list box by using the given handle of the display device.
Public static int WM_CTLCOLORLISTBOX = 0x134;
// Send this message to its parent window when a button control is to be drawn by responding to this message, in the owner window, you can set the text and background color of the button by using the handle of the specified display device.
Public static int WM_CTLCOLORBTN = 0x135;
// When a dialog box control sends this message to its parent window before being drawn, it responds to this message, in the owner window, you can set the text background color of the dialog box by using the corresponding display device handle.
Public static int WM_CTLCOLORDLG = 0x136;
// Send this message to its parent window when a scroll bar control is to be drawn by responding to this message, in the owner window, you can set the background color of the scroll bar by using the corresponding display device handle.
Public static int WM_CTLCOLORSCROLLBAR = 0x137;
// Send this message to its parent window when a static control is to be drawn by responding to this message, in the owner window, you can set the text and background color of the static control by using the given handle of the display device.
Public static int WM_CTLCOLORSTATIC = 0x138;
// Send the message a control with focus when the mouse wheel turns
Public static int WM_MOUSEWHEEL = 0x20A;
// Double-click the middle mouse button
Public static int WM_MBUTTONDBLCLK = 0x209;
// Release the middle mouse button
Public static int WM_MBUTTONUP = 0x208;
// When the mouse is moved, it is the same as WM_MOUSEFIRST.
Public static int WM_MOUSEMOVE = 0x200;
// Press the left mouse button
Public static int WM_LBUTTONDOWN = 0x201;
// Release the left mouse button
Public static int WM_LBUTTONUP = 0x202;
// Double-click the left mouse button
Public static int WM_LBUTTONDBLCLK = 0x203;
// Right-click
Public static int WM_RBUTTONDOWN = 0x204;
// Right-click release
Public static int WM_RBUTTONUP = 0x205;
// Right-click
Public static int WM_RBUTTONDBLCLK = 0x206;
// Press the middle mouse button
Public static int WM_MBUTTONDOWN = 0x207;

Public static int WM_USER = 0x0400;
Public static int MK_LBUTTON = 0x0001;
Public static int MK_RBUTTON = 0x0002;
Public static int MK_SHIFT = 0x0004;
Public static int MK_CONTROL = 0x0008;
Public static int MK_MBUTTON = 0x0010;
Public static int MK_XBUTTON1 = 0x0020;
Public static int MK_XBUTTON2 = 0x0040;
// Create a window
Public static int WM_CREATE = 0x01;
// Send when a window is damaged
Public static int WM_DESTROY = 0x02;
// Move a window
Public static int WM_MOVE = 0x03;
// Change the size of a window
Public static int WM_SIZE = 0x05;
// A window is activated or inactive
Public static int WM_ACTIVATE = 0x06;
// Obtain the focus in a window
Public static int WM_SETFOCUS = 0x07;
// A window loses focus
Public static int WM_KILLFOCUS = 0x08;
// A window changes to the Enable state.
Public static int WM_ENABLE = 0x0A;
// Set whether the window can be re-painted
Public static int WM_SETREDRAW = 0x0B;
// The application sends this message to set the text of a window
Public static int WM_SETTEXT = 0x0C;
// The application sends this message to copy the text of the corresponding window to the buffer zone.
Public static int WM_GETTEXT = 0x0D;
// Obtain the length of the text related to a window (excluding empty characters)
Public static int WM_GETTEXTLENGTH = 0x0E;
// Ask a window to redraw itself
Public static int WM_PAINT = 0x0F;
// Send a signal when a window or application is closed
Public static int WM_CLOSE = 0x10;
// When the user selects the end dialog box or the program calls the ExitWindows Function
Public static int WM_QUERYENDSESSION = 0x11;
// Used to end the program running
Public static int WM_QUIT = 0x12;
// Send the message to an icon when the user window recovers the previous size position.
Public static int WM_QUERYOPEN = 0x13;
// When the window background must be erased (for example, when the window size changes)
Public static int WM_ERASEBKGND = 0x14;
// Send this message to all top-level windows when the system color changes
Public static int WM_SYSCOLORCHANGE = 0x15;
// When the system process sends the WM_QUERYENDSESSION message, the message is sent to the application to notify the application of whether the conversation ends.
Public static int WM_ENDSESSION = 0x16;
// Send this message to the hidden or displayed window
Public static int WM_SHOWWINDOW = 0x18;
// Send this message to the application. Which window is activated and which is not activated?
Public static int WM_ACTIVATEAPP = 0x1C;
// Send this message to all top-level windows when the font resource library of the system changes
Public static int WM_FONTCHANGE = 0x1D;
// Send this message to all top-level windows when the system time changes
Public static int WM_TIMECHANGE = 0x1E;
// Send this message to cancel an ongoing touch (Operation)
Public static int WM_CANCELMODE = 0x1F;
// If the mouse causes the cursor to move in a window and the mouse input is not captured, a message is sent to a window.
Public static int WM_SETCURSOR = 0x20;
// When the cursor is in an inactive window and the user is pressing the mouse key to send this message to the current window
Public static int WM_MOUSEACTIVATE = 0x21;
// Send this message to the MDI subwindow // when the user clicks the title bar of this window, or // when the window is activated, moved, and changed
Public static int WM_CHILDACTIVATE = 0x22;
// This message is sent by a computer-based training program. The user input message is separated by the WH_JOURNALPALYBACK hook program.
Public static int WM_QUEUESYNC = 0x23;
// This message is sent to the window when it is about to change the size or position
Public static int WM_GETMINMAXINFO = 0x24;
// Send it to the minimized window when its icon is to be repainted
Public static int WM_PAINTICON = 0x26;
// This message is sent to a minimal window, only // The background must be repainted before it is painted.
Public static int WM_ICONERASEBKGND = 0x27;
// Send this message to a dialog box program to change the focus position
Public static int WM_NEXTDLGCTL = 0x28;
// Send this message whenever a job is added or removed in the print management queue
Public static int WM_SPOOLERSTATUS = 0x2A;
// Send a message when the visual appearance of button, combobox, listbox, and menu changes
Public static int WM_DRAWITEM = 0x2B;
// When button, combo box, list box, list view control, or menu item is created
Public static int WM_MEASUREITEM = 0x2C;
// This message has an LBS_WANTKEYBOARDINPUT style that is sent to its owner to respond to the WM_KEYDOWN message.
Public static int WM_VKEYTOITEM = 0x2E;
// This message is sent to its owner by a list box in the LBS_WANTKEYBOARDINPUT style to respond to the WM_CHAR message.
Public static int WM_CHARTOITEM = 0x2F;
// When drawing text, the program sends this message to obtain the color used by the Control
Public static int WM_SETFONT = 0x30;
// The application sends this message to obtain the font of the text drawn by the current control.
Public static int WM_GETFONT = 0x31;
// The application sends this message to connect a window to a hotkey.
Public static int WM_SETHOTKEY = 0x32;
// The application sends this message to determine whether the hotkey is associated with a window.
Public static int WM_GETHOTKEY = 0x33;
// The message is sent to the minimal window. When the window is to be dragged and its class does not have a defined icon, the application can return an icon or a cursor handle, this icon or cursor is displayed when you drag and drop an icon.
Public static int WM_QUERYDRAGICON = 0x37;
// Send this message to determine the relative position of the newly added items in combobox or listbox
Public static int WM_COMPAREITEM = 0x39;
// The Display memory is very small.
Public static int WM_COMPACTING = 0x41;
// When the size and position of the window to which the message is sent are about to be changed, call the setwindowpos function or other window management functions.
Public static int WM_WINDOWPOSCHANGING = 0x46;
// Call the setwindowpos function or other window management functions when the size and position of the window to which the message is sent have been changed.
Public static int WM_WINDOWPOSCHANGED = 0x47;
// Send this message when the system is about to pause
Public static int WM_POWER = 0x48;
// Send this message when one application transmits data to another application
Public static int WM_COPYDATA = 0x4A;
// When a user cancels the activation status of the program log, submit the message to the program
Public static int WM_CANCELJOURNA = 0x4B;
// When an event of a control has occurred or the control needs to obtain some information, send the message to its parent window
Public static int WM_NOTIFY = 0x4E;
// When the user selects an input language or the hotkey of the input language changes
Public static int WM_INPUTLANGCHANGEREQUEST = 0x50;
// Send this message to the affected top-level window when the platform site has been changed
Public static int WM_INPUTLANGCHANGE = 0x51;
// Send this message to the application when the program has initialized the windows Help routine
Public static int WM_TCARD = 0x52;
// The message indicates that the user presses F1. If a menu is activated, the user sends the message to the menu associated with the window; otherwise, the message is sent to the window with focus, if no focus exists at the moment, send the message to the // currently activated window.
Public static int WM_HELP = 0x53;
// Send this message to all windows after the user has logged on or exited. // The system updates the user's specific settings when the user logs on or exits, the system sends this message immediately when the user updates the settings.
Public static int WM_USERCHANGED = 0x54;
// Public controls, custom controls, and their parent Windows use this message to determine whether the controls use the ANSI or UNICODE Structure
Public static int wm_policyformat = 0x55;
// Right-click a user in a window and send the message to this window.
// Public static int WM_CONTEXTMENU = ??;
// Send this message to the window when the SETWINDOWLONG function is called to change the style of one or more windows
Public static int WM_STYLECHANGING = 0x7C;
// Send this message to the window when you call the SETWINDOWLONG function in one or more window styles
Public static int WM_STYLECHANGED = 0x7D;
// Send this message to all windows when the resolution of the monitor changes
Public static int WM_DISPLAYCHANGE = 0x7E;
// This message is sent to a window to return the handle of the large icon or small icon associated with a window.
Public static int WM_GETICON = 0x7F;
// The program sends this message to associate a new large icon or small icon with a window
Public static int WM_SETICON = 0x80;
// When a window is created for the first time, the message is sent before the WM_CREATE message is sent.
Public static int WM_NCCREATE = 0x81;
// This message notifies a window in which a non-customer zone is being destroyed
Public static int WM_NCDESTROY = 0x82;
// Send this message when the customer region of a window must be calculated
Public static int WM_NCCALCSIZE = 0x83;
// When you move the mouse, hold it down or release it
Public static int WM_NCHITTEST = 0x84;
// The program sends this message to a window. When the frame of the window must be drawn
Public static int WM_NCPAINT = 0x85;
// This message is sent to a window only when its non-customer zone needs to be changed to show whether the message is active or not.
Public static int WM_NCACTIVATE = 0x86;
// Send this message to a control associated with the dialog box program. The widdows control orientation key and TAB key enable the input to enter the control through the corresponding
Public static int WM_GETDLGCODE = 0x87;
// When the cursor moves in a non-customer area of a window, the message is sent to the non-customer area of the window: The title bar of the form and the border body of the window.
Public static int WM_NCMOUSEMOVE = 0xA0;
// This message is submitted when the cursor is pressed with the left mouse button in a non-customer area of a window.
Public static int WM_NCLBUTTONDOWN = 0xA1;
// When the user releases the left mouse button and a window with the cursor sends this message in non-customer Zone 10
Public static int WM_NCLBUTTONUP = 0xA2;
// When you double-click the left mouse button and a window with the cursor sends this message in non-customer Zone 10
Public static int WM_NCLBUTTONDBLCLK = 0xA3;
// This message is sent when you right-click the user and the cursor is in a non-customer area of the window.
Public static int WM_NCRBUTTONDOWN = 0xA4;
// This message is sent when the user releases the right mouse and the cursor is in a non-customer area of the window.
Public static int WM_NCRBUTTONUP = 0xA5;
// When you double-click a user and right-click the mouse, a window with the cursor sends the message in non-customer Zone 10
Public static int WM_NCRBUTTONDBLCLK = 0xA6;
// Send this message when you press the middle mouse button and the cursor is in a non-customer area of the window
Public static int WM_NCMBUTTONDOWN = 0xA7;
// This message is sent when the user releases the middle mouse button and the cursor is in a non-customer area of the window.
Public static int WM_NCMBUTTONUP = 0xA8;
// This message is sent when you double-click the middle mouse button and the cursor is in a non-customer area of the window.
Public static int WM_NCMBUTTONDBLCLK = 0xA9;

[DllImport ("user32.dll")]
Public static extern int SendMessage (IntPtr hWnd, int Msg, int wParam, int lParam );

// This is mainly used to place the window at the beginning (SetWindowPos (this. Handle,-0002, 0, 0, 0x4000 | 0x0001 | 0 x );)
[System. Runtime. InteropServices. DllImport ("user32.dll")]
Public static extern bool SetWindowPos (IntPtr hWnd,
Int hWndInsertAfter,
Int X,
Int Y,
Int cx,
Int cy,
Int uFlags
);

 

This article from the CSDN blog, reproduced please indicate the source: http://blog.csdn.net/jy251/archive/2009/08/20/4465300.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.