??? First, thank you old birds for so long to give your younger brother so long, give your younger brother more help, so you can make my first technical article so soon as you meet! Today, today is the young brother, 20th birthday, no one celebrates me, so write articles to make a commemoration, I wish myself a happy birthday! ^ o ^
??? I have learned Delphi for half a year. I saw many friends on the Internet very interested in hook. Therefore, I have written an article. In the 9CBS, the younger brother once sent a "Delphi's MU window code" (啊) Since then, there are many places not very perfect, and this article will re-detail Introduce the usage of the message hook function under Windows and the subclass of Windows, I hope to help you.
??? Ok, nonsense for so long, I have entered the topic, and there should be no more introduced about hook. There have been many examples and articles can be referred to, I can't do Google or Baidu! ^ _ ^
First let's take a look at the function of installing hook:
HHOOK SETWINDOWSHOKEX (??? Int IDHOK, ??????? // Type to install Hook ?? HookProc LPFN, ??? // hook callback function ????? Process ?? DWORD DWTHREADID? // The thread of the program, if 0 is a full hook;
Familiar with the SetWindowsHookex function, we can start our work, hook the process. First open Delphi, create a DLL engine (DLL Wizard). Then create a new unit (Unit1). First, the functions to be used below the unit's interface is declared.
Var ?? oldhook: hhook; ??? histance: histance; ???? oldproc: farproc
Our first function is to install hook, let's take a look at the code:
Function setook: boolean; stdcall; begin ?? Oldhook: = setWindowshookex (wh_keyboard, @ hookproc, histance, 0); ?? IF (Oldhook = 0) THEN EXIT ELSE RESULT: = true; end;
In this way, there is still a lot of ways to install a global keyboard hook, hook methods, which are not listed here.
Let's introduce the callback function:
Function HookProc (Ncode, WPARAM, LPARAM: Integer; Integer; Stdcall; Begin ?? Result: = CallNextHookex (Oldhook, Ncode, WPARAM, LPARAM); END;
In this way, the hook of the process is completed. However, the hook is hooked, and our work is not over. On the contrary, our work has just begun. The role of the hook is to help us inject the DLL into someone else's process space. Now our DLL is already in someone else's process space. So, we can do what we want to do.
Let's introduce the subclass of Windows.
Everyone knows that no matter what you do in Windows, you will send a message to Windows, and then the corresponding processing will be processed by Windows will return to the application. That everyone will ask: "Hook is not to intercept the Windows message?"
Yeah, then I have to intercept what news, just as I wrote about wh_keyboard above, we intercept the keyboard message, we can do it when you press any button. There are many kinds of messages. But what we have to talk about today is the subclass of Windows, which is another new technology. Not nonsense, this begins. ^ _ ^
I believe that everyone has seen two APIs: getWindowslong and setwindowlong; maybe you will say, are these not processing window messages? Yes, this is the API we have to use.
Let's take a look at the parameters of these APIs. Long getWindowlong (?? hWnd hwnd, ??? // The handle of the form ?? INT NINDEX ??? // For information on which you want to go, you can refer to the following table) ;? Nindex value can be any of the following GWL_EXStyle Extended Window Style GWL_Style Window Style GWL_WndProc This window function of the window function of the window GWL_HINSTANCE has a handle of the exemplary of the window GWL_HWndparent that the parent of the window. Do not use setWindowWord to change this value GWL_ID dialog box identifier GWL_USERDATA meaning by application specifying DWL_DLGPROC This window of the dialog function address DWL_MSGRESULT DWL_MSGRESULT Handled in the dialog function DWL_User meaning by the value DWL_User meaning by application
Maybe you will notice the parameters of GWL_WndProc. That's right, our subclass processing is to use this parameter. The code is as follows: OldProc: = getWindowlong (hwnd, gwl_wndproc);
This way our OldProc points to the window function address of the form; since it gets the window function address, then modify it to our custom message processing address. Below you will use the setwindowlong function. Long setWindowlong (??? hwnd hwnd, ????? // Specify window handle ??? INT NINDEX, ???? //, like getWindowlong NINDEX ??? long dwnewlong? // New message processing address) ;
The code is as follows: setWindowlong (hwnd, gwl_wndproc, longint (@winproc));
This turns the message of the specified form to our function;
The callback function is as follows: Function WinProc (HWND, MSG, WPARAM, LRESULT; STDCALL; BeginResult: = CallWindowProc (OldProc, HWND, MSG, WPARAM, LPARAM); END; The MSG here is the message of the window, Message table.
Section: Articles Writes here, I believe everyone should understand what Huok and subclasses are going. Let's explain why you don't process your messages in your hook. As mentioned earlier, Hook is to help us inject DLL into other people's processes. Windows sub-processing can only process messages within the process, so we can make a message shielding action only in the process space of others. This way, everyone can understand.
??? Ok, it is not nonsense. The upper source code is assigned below. I hope everyone will support it! ^ _ ^ ??? (can be used by copy)
######################################################################################################################################################################################################################################################################################################## ##################### Unit unit1;
InterfaceUses Windows; var ??? oldhook: hhook; ??????? // Used to save the return value of HOOK ??? Oldproc: farProc; ????? // used to point to window messages
??? function sethook: boolean; stdcall; ??? function hookproc (ncode, wparam, lparam: integer): integer; stdcall; ??? function WinProc (hwnd, msg, wparam, lparam: long): LResult; stdcall; ??? IMPLEMENTATION {####################################################################################################################################################################################################################################################################### ############################################################################################# ??? histance: cardinal; begin ?? // Install hook ?? Oldhook: = setWindowshookex (wh_keyboard, @ hookproc, histance, 0); ?? IF (Oldhook = 0) THEN EXIT ELSE RESULT: = true; end; { ######################################################################################################################################################################################################################################################################################################## #########################} // hook callback function function hookproc (ncode, wparam, lparam: integer) : Integer; stdcall; varwinstr: hwnd; begin ?? // Set hotkey ?? IF (wparam = vk_f12) THEN ??? begin ????? Winstr: = FINDWINDOW (NIL, the title text "of the 'window); ????? Oldproc: = farProc (Winstr, gwl_wndproc); ????? SetWindowlong (Winstr, GWL_WNDPROC, Longint (@winproc)); ??? End; ?? // Pass Hook to Windows Processing ?? Result: = CallNextHookex (Oldhook, Ncode, WPARAM, LPARAM);
{############################################################################ ##########################} // Custom Windows message processing function Function WinProc (hwnd, msg, WPARAM, LPARAM: Longint): LRESULT; stdcall; begin {processing of messages
?? case msg of ??? WM_ActivateApp: exit; ??? wm_Activate: exit; ??? WM_KILLFOCUS: EXIT; ??? WM_SETFOCUS: EXIT; ?? End; above, the message is the window lost focus and the focus of the focus} // Transfer window messages to Windows result: = CallWindowProc (OldProc, HWND, MSG, WPARAM, LPARAM); END; END.
######################################################################################################################################################################################################################################################################################################## ################################
?
Appendix: Message Type (Collection is in the Internet)
######################################################################################################################################################################################################################################################################################################## ################################
WM_NULL = 0000; WM_CREATE = $ 0001; application creates a window WM_DESTROY = $ 0002; one window is destroyed WM_MOVE = $ 0003; moving a window WM_SIZE = $ 0005; change a window of the size WM_ACTIVATE = $ 0006; one window is activated or lost activation state; WM_SETFOCUS = $ 0007; WM_KILLFOCUS = $ 0008 after getting focus; lost focus WM_ENABLE = $ 000A; change Enable Status WM_SETREDRAW = $ 000B; Settings Window can redraw WM_SETTEXT = $ 000c; the application sends this message to set the text WM_Gettext = $ 000d; application sends this message to copy the text to the buffer wm_gettextLength = $ 000E for the corresponding window; get the length of the text related to a window (not including empty characters) WM_Paint = $ 000F; ask one window to call yourself WM_CLOSE = $ 0010; send a signal WM_QUERYENDSESSION = $ 0011 when a window or application is to be turned off; when the user selects the end dialog or the program you call the exitwindows function wm_quit = $ 0012; used to end the program to run or when the program calls PostquitMessage function wm_quitMessage function wm_quitMessage function WM_QUERYOPEN = $ 0013; When the user window restores the previous size position, send this message to an icon WM_ERASEBKGND = $ 0014; when the window background must be erased (case change the size of the window) WM_SYSCOLORCHANGE = 0015; send this message when the system color changes, send this message Give all top windows WM_ENDSESSION = $ 0016; After the system process issues a WM_QueryEndSession message, this message is sent to the application, informs it to end WM_SYSTEMERROR = $ 0017; WM_SHOWINDOW = 0018; when the hidden or display window is sent to this message to this message to this message to this message WM_ACTIVATEAPP = $ 001c; Send this message Which window is activated, which is not activated; WM_FONTCHANGE = 001D; send this message when the system's font resource library changes this message to all top windows WM_TIMECHANGE = $ 001E; When the time change is sent to all top-level windows WM_CANCELMODE = $ 001F; send this message to cancel some of the ongoing touch state (operation) WM_SETCURSOR = $ 0020; if the mouse is moved in a window and the mouse input is not captured When you send a message to a window WM_MouseActivate = $ 0021; When the cursor is in a non-activated window and the user is in pressing a key in a mouse to send this message to the current window WM_CHILDACTIVATE = $ 0022; send this message to the MDI sub-window When the user clicks on this window, or when the window is activated, move, change the size WM_QUEESYNC = 0023; this message is sent by the computer-based training program, separating the user input message wm_getminMaxInfo = $ 0024 via the HOOK program of WH_Journalpalyback Give the window When it will change the size or position; WM_PaintICON = $ 0026; Send to Minimize Window When it is the icon to be edited WM_ICONERASEBKGND = $ 0027; this message is sent to a minimum window,
Only when it is drawn, it must be redrawed by WM_NEXTDLGCTL = $ 0028; send this message to a dialog program to change the focus position wm_spoolersTatus = $ 002a; Whenever the print management column increases or decreases this message WM_DRAWITEM = 002b; When the visual appearance of Button, ComboBox, ListBox, send this message to these empty owners WM_MeasureItem = $ 002c; when Button, Combo Box, List Box, List View Control, Or Menu Item Send this message to the owner of the control WM_DELETEITEM = $ 002d; when the list box or Combo Box is destroyed or when some item is removed through lb_delected, or cb_resetcontent message WM_VKEYTOITEM = 002E; this message has one The LBS_WANTKEYBOARDINPUT style is sent to it to respond to the WM_KeyDown message WM_CHARTOITEM = $ 002f; this message is sent to his owner by a list box of LBS_WANTKEYBOARDINPUT style to respond to WM_CHAR messages WM_SETFONT = $ 0030; when drawing text, the program is sent this message The color wm_getfont = $ 0031; the application sends this message to get the current control to draw the text of the text WM_SETHOTKEY = $ 0032; the application sends this message to let a window associated with a hotkey WM_GETHOTKEY = $ 0033; application sends this message to determine The hotkey is associated with a window WM_QueryDragicon = $ 0037; this message is sent to the minimized window, when this window will be dragged and dropped, the application can return an icon in its class, the application can return an icon or cursor handle, when a user When drag and drop icon, the system displays this icon or cursor wm_compareItem = $ 0039; send this message to determine the relative position of ComboBox or Listbox added items wm_getObject = $ 003d; wm_compacting = $ 0041; Show memory has rarely wm_windowposchanging = $ 0046; Send this message to the size and location of the window will be changed to call the SETWINDOWPOS function or other window management function wm_windowposchanged = 0047; send this message to the SetWindowPos function or other window when the size and location of the window have been changed. Manage function wm_power = $ 0048; (for 16-bit Windows) When the system will send this message WM_COPYDATA = $ 004A when the system will enter the paused state; send this message when an application delivers data to another application WM_CANCELJournallNal = 004B; A user cancels the program log activation status, submit this message to the program WM_NOTIFY = 004E; send this message to its parent window WM_INPUTLANGCHANGEREQUEST = $ 0050 when an event of a control has occurred or this control needs to get some information When the user selects a certain input language, or the hotkey of the input language changes WM_INPUTLANGCHANGE = 0051; when the platform has been changed, this message is sent to the affected top window WM_TCARD = $ 0052; when the program has initialized the Windows Help routine This message gives the application WM_HELP = $ 0053; this message shows that the user presses F1, if a menu is activated,
Just send this message, this window is associated with the menu, otherwise send it to the focus window. If there is no focus, you will send this message to the current activation window WM_UserChanged = $ 0054; send this message when the user has logged in or exited Give all the windows, when the user logs in or exits, the system updates the user's specific setting information, the system will send this message immediately when the user update settings; WM_NOTIFORMAT = $ 0055; public control, custom control, and their parent window to judge The control is to use ANSI or the Unicode structure in the WM_NOTIFY message, using this control to communicate with each other with its parent controls WM_CONTEXTMENU = 007b; when the user clicks on a window, send this message to this message. Window WM_StyleChanging = 007c; When the calling setWindowlong function will change this message to the window WM_Stylechanged = $ 007D when the SETWINDOWLONG function is changed; when calling the setWindowlong function one or more windows, send this message to that window WM_DISPLAYCHANGE = 007E; Send this message to all windows wm_geticon = $ 007f after the resolution change changes; this message is sent to a window to return to a large icon or a small icon for a window; wm_seticon = $ 0080 The program sends this message to let a new big icon or small icon associate with a window; WM_NCCREATE = $ 0081; When a window is created first, this message is sent before the WM_CREATE message is sent; WM_NCDESTROY = 0082; this message Informing a window, the non-client area is destroying WM_NCCALCSIZE = $ 0083; send this message when a window must be asked to send this message WM_NCHITTEST = $ 0084; / / Move the mouse, hit or release the mouse when the mouse is sent to the mouse, WM_NCPAINT = $ 0085; program sends This message gives a window when it (windows) must be drawn; wm_ncactivate = $ 0086; This message is sent to a window only when its non-client area needs to be changed to display is activated or inactive; wm_getdlgcode = $ 0087; Send this message to a control associated with the dialog program, the Widdows Control orientation button and Tab keys make the 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 is transmitted when the cursor is moving in a window to move this message to this window // Non-customer area: Form's title bar and window of the edge of the window WM_NCLBUTTONDOWN = $ 00A1; as cursor in one window When the non-customer zone simultaneously presses the left mouse button, this message is submitted to this message WM_NCLBUTTONUP = $ 00a2; when the user releases the left mouse button, the cursor is sent in the non-client zone ten; wm_nclbuttondblclk = $ 00A3; when the user doubles the left mouse button At the same time, a window sent this message in a non-customer zone 10 for the non-client district 10; when the user presses the mouse button, the cursor is sent to the window's non-client district, WM_NCRBUTTONUP = $ 00A5; when the user releases the mouse button, the cursor Send this message when the window is in the non-client district; when the user doubles the mouse button, the spectrum is sent in the non-customer zone 10, the message is sent this message wm_ncmbuttondown = $ 00A7; when the user presses the mouse button while the cursor is in the window This message is sent when the non-client district is sent to WM_NCMBUTTONUP = $ 00A8;
When the user releases the mouse button while the cursor is sent to the window's non-client district when the window is sent this message WM_NCMBUTTONDBLCLK = $ 00A9; ; // Press a key WM_KEYUP = $ 0101; // Release a key WM_CHAR = $ 0102; // Press a key and have issued WM_KEYDOWN, WM_KEYDOWN, WM_DEADCHAR = $ 0103; send this message when translating the WM_KEYUP message with TranslateMessage functions Have a focus window 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 button is saved to have this message focus window WM_SYSCHAR = $ 0106; when WM_SYSKEYDOWN message after being TRANSLATEMESSAGE function translated submitting this message to the window WM_SYSDEADCHAR has focus = $ 0107; when WM_SYSKEYDOWN message is transmitted this message TRANSLATEMESSAGE function translated to a window with the focus WM_KEYLAST = $ 0108; WM_INITDIALOG = $ 0110 This message is sent to it before a dialog program is displayed, which usually uses 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 key is translated WM_SYSCOMMAND = $ 0112; when the user selects a command to select the window menu or when the user selects maximizes or minimizes the message WM_TIMER = $ 0113; // The timer event WM_HSCROLL = $ 0114; A window standard horizontal scroll bar generates a scrolling event to send this message to that window, also sent to the control WM_VSCROLL = $ 0115 with its control; when a window standard vertical scroll bar generates a scrolling event to send this message to that window, send Give it a control WM_INITMENU = $ 0116; when a menu will be activated, it will send this message in the user menu bar or pressed a menu button, which allows the program to change the menu WM_INITMENUPOPUPUPUP = $ 0117; As a down The pull menu or submenu will be sent to send this message when it is activated, which allows the program to change the menu before it is displayed, not to change all WM_MENUSELECT = 011f; send this message to the menu when the user selects a menu item (generally Window) WM_MenuChar = $ 0120; When the menu has been activated by the user (different from the acceleration key), send this message to the owner of the menu; WM_EnterIdle = $ 0121; when a modal dialog or menu enters an empty state When you send this message to its owner, a modal dialog or menu enters the no-load status is to wait for one or more previous messages, there is no message to wait for WM_MenurButtonup = $ 0122; wm_menudrag = $ 0123; wm_MenugetObject = $ 0124; wm_uninitMenupopupup = $ 0125; wm_menucommand = $ 0126; wm_changeuistate = $ 0127; wm_updateuistate = $ 0128; wm_quryuistate = $ 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 wm_ctlcoloredit = $ 0133 by using the handle of a given related display device. When a editing control will be drawn, you will send this message to its parent window; by responding to this message, the owner window can set the edit box for text and background color wm_ctlcolorListbox = $ 0134 by using the handle of the given related display device. When a list box control will send this message to the parent window to send this message before being drawn; by responding to this message, the owner window can set the text and background color wm_ctlcolorbtn = of the list box by using the handle of the given related display device. $ 0135; When a button control will send this message to the parent window; by responding to this message, the owner window can set the text and background color wm_ctlcolordlg = by using the handle of a given relevant display device. $ 0136; When a dialog control will send this message to its parent window before being drawn; By responding to this message, the owner window can set the text background color wm_ctlcolorscrollbar = by using the handle of the given related display device. $ 0137; When a scroll strip control will be drawn, 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 the parent window; by responding to this message, the owner window can set the text and background color wm_mousefirst = $ 0200 by using the handle of the given related display device. WM_MOUSEMOVE = $ 0200; // 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 mouse right button WM_RBUTTONDBLCLK = $ 0206; // Double-click the mouse button WM_MBUTTONDOWN = $ 0207; // Press the mouse button WM_MBUTTONUP = $ 0208; // Release mouse button WM_MBUTTONDBLCLK = $ 0209; / / Double-click the mouse button WM_MouseWheel = $ 020A; send this message when the mouse wheel rotates WM_MouseLast = $ 020A; WM_ParentNotify = $ 0210; when the MDI sub-window is created or destroyed, or the user pressed A mouse button and the cursor sends this message 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 Window That has exited menu loop mode WM_NEXTMENU = $ 0213; wm_sizing = 532; When the user is adjusting the window to send this message to the window; you can monitor the window size and location 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 when the mobile window, this message application can monitor the window size and position can also modify them; wm_powerbroadcast = 536;
This message is sent to the application to inform it to notify the power management event; WM_DeviceChange = 537; send this message when the device's hardware configuration changes to the application or device driver WM_IME_StartComposition = $ 010d; wm_ime_endcomposition = $ 010e; wm_ime_composition = $ 010f; WM_IME_KEYLAST = $ 010F; WM_IME_SETCONTEXT = $ 0281; WM_IME_NOTIFY = $ 0282; WM_IME_CONTROL = $ 0283; WM_IME_COMPOSITIONFULL = $ 0284; WM_IME_SELECT = $ 0285; WM_IME_CHAR = $ 0286; WM_IME_REQUEST = $ 0288; WM_IME_KEYDOWN = $ 0290; WM_IME_KEYUP = $ 0291; WM_MDICREATE = $ 0220; application to send this message Give a multi-document customer window to create a 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; application sends this message to a multi-document client window to inform customers The window activates another MDI sub-window. After the customer window receives this message, it issues a WM_MDIACTIVE message to activate it to the MDI sub-window (not activated); WM_MDIRESTORE = 0223; program sends this message to the MDI customer window to make sub-window from the maximum and minimum Restore to the original size WM_MDINEXT = $ 0224; program sends this message to the MDI customer window to activate the next or the previous window WM_MDIMAXIMIZE = $ 0225; the program sends this message to maximize a MDI customer window; WM_MDITILE = $ 0226; program sends This message rearranges all MDI sub-window WM_MDICASCADE = $ 0227 to the MDI client window; program sends this message to the MDI customer window to rearrange all MDI sub-window WM_MDIICONARRANGE = $ 0228; program sends this message to the MDI customer window Arrange all minimized MDI sub-windows WM_MDiGetActive = $ 0229; program sends this message to the MDI customer window to find activation Handle WM_MDISETMENU child windows = $ 0230; sends this message to the MDI client window instead of the menu WM_ENTERSIZEMOVE child window by MDI menu = $ 0231; WM_EXITSIZEMOVE = $ 0232; WM_DROPFILES = $ 0233; WM_MDIREFRESHMENU = $ 0234; WM_MOUSEHOVER = $ 02A1; WM_MOUSELEAVE = $ 02A3 WM_CUT = $ 0300; program sends this message to an edit box or ComboBox to delete the currently selected text wm_copy = $ 0301; program sends this message to a edit box or ComboBox to copy the currently selected text to the clipboard WM_PASTE = $ 0302; program sends This message gives EditControl or ComboBox from the clipboard from the clipboard; program sends this message to eDitControl or ComboBox clears the currently selected content; WM_UNDO = $ 0304; program sends this message to editcontrol or ComboBox revoked last operation WM_Renderformat = $ 0305;
WM_RENDERALLFORMATS = $ 0306; WM_DESTROYCLIPBOARD = $ 0307; When the EnPtyClipboard function is called to send this message to the owner of the clipboard WM_DRAWCLIPBOARD = $ 0308; send this message to the first window of the clipboard to observe the chain when the content changes of the clipboard; it allows Clipboard Watch window to display new content of the clipboard; WM_PaintClipboard = $ 0309; when the clipboard contains data in the CF_OWNERDIPLAY format and the clipboard observation window needs to be heavy; WM_VSCROLLLPBOARD = $ 030A; WM_SIZECLIPBOARD = 030b; when the clipboard contains CF_OWNERDIPLAY format data and the size of the client area of the clipboard observation window has changed that this message is sent to the owner of the clipboard via the clipboard watch window; WM_ASKCBFORMATNAME = $ 030c; send this message to the clipboard through the clipboard watch window Let's request a clipboard of a CF_OWNERDISPLAY format WM_CHANGECBCHAIN = $ 030D; send this message to the first window of the clipboard observe the chain when the window is removed from the clipboard observation chain; WM_HScrollClipboard = $ 030E; this message passes A clipboard observation window sent to the owner of the clipboard; 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; the owner should scroll the clipboard image and update scrolling The value of the bar; WM_QUERYNEWPALETTE = $ 030f; This message is sent to the window to receive the focus, this message can make the window when you receive the focus, have the opportunity to achieve his logical palette WM_PALETTEISCHANGINGING = $ 0310; when an application is When you implement its logical palette, you send this message to all applications WM_Palettechanged = $ 0311; this message is sent to all top-level and overlapping windows after implementing its logical palette after a window with focus. Change the system palette WM_HOTKEY = $ 0312; submit this message when the user is pressed by the hotkey registered by the RegisterhotKey function; the application sends this message only as part of the request request request request request request requirements ; Wm_printclient = 792; wm_handheldfi RST = 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 to submit the message starts a program with the server The session responds 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 A DDE service program requests the server whenever the data item is updated when the data item changes when the data item changes, a DDE client notifies a DDE service that does not update the specified item or a special clipboard format Item WM_DDE_ACK = WM_DDE_FIRST 4; This message notifies a DDE (
Dynamic Data Exchange) program has been received and is being 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; submit a DDE message to the service program a DDE client to transfer a data item to the client or Inform the customer's available data item 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, 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 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 can help the application custom private message; / Notification Message refers to such a message, some of the child controls in one window, need to notify the parent window. The notification message is only available for standard window controls such as buttons, list boxes, combo boxs, edit boxes, and Windows 95 public controls such as tree views, list views, etc. For example, click or double-click a control, select some text in the control, and the scroll bar of the operating control will generate a notification message.
Team BN _ Clicked // User Click the button BN _ Disable // Button BN _ DoubleClicked // User Double-click the button BN _ hilite // User Highlight button BN _ PA INT button should be redrawed BN _ UnHilite Highlights the combination box CBN _ Closeup combination box list box is turned off _ DBLCLK users Double-click a string CBN _ DROPDOWN combination box list box to pull out the CBN _ EditChange user modified the text in the edit box _ EditUpd The text in the AT E Edit box is about to update the CBN _ ERRS PA CE combination box memory insufficient CBN _ KILLFOCUS combination box Lost input focus CBN _ SELCHANGE Select a CBN in the combo box _ SelendCanCel users should be canceled CBN _ Selendok users The choice is a legal CBN _ setfocus combo box get the input focus edit box en _ Change edit box text EN _ Errs PA CE edit box memory insufficient EN _ HScroll users Click horizontal scroll bar en _ Killfocus edit box is being lost Enter the focus EN _ MAXTEXT Inserted Content Truncated EN _ SETFOCUS Edit box Get the input focus EN _ UPD AT E Edit box text will be updated EN _ vscroll users Click the vertical scroll bar message Meaning list box LBN _ DBLCLK users double click one Item LBN _ ERRS PA CE list box memory is not enough LBN _ KILLFOCUS list box is losing input focus LBN _ SELCANCEL selection is canceled LBN _ SELCHANGE Select another LBN _ setfocus list box Get input focus ################################################################################################################################################################################################################################################################################################# ##########################################