小弟收集了些windows消息的用法,特与大家共享(200分)

  • 主题发起人 主题发起人 cool_cool
  • 开始时间 开始时间
C

cool_cool

Unregistered / Unconfirmed
GUEST, unregistred user!
小弟收集了些windows消息的用法,特与大家共享,由于水平有限,望各位高手能指出错误<br>提出更多的关于windows消息的用法,重金酬献¥¥¥<br><br>、<br><br><br>消息,就是指Wi n d o w s发出的一个通知,告诉应用程序某个事情发生了。例如,单击鼠标、改变<br>窗口尺寸、按下键盘上的一个键都会使Wi n d o w s发送一个消息给应用程序。<br>消息本身是作为一个记录传递给应用程序的,这个记录中包含了消息的类型以及其他信息。例如,<br>对于单击鼠标所产生的消息来说,这个记录中包含了单击鼠标时的坐标。这个记录类型叫做T M s g,它<br>在Wi n d o w s单元中是这样声明的:<br>t y p e<br>TMsg = packed record<br>hwnd: HWND; / /窗口句柄<br>message: UINT; / /消息常量标识符<br>wParam: WPA R A M ; // 32位消息的特定附加信息<br>lParam: LPA R A M ; // 32位消息的特定附加信息<br>time: DWORD; / /消息创建时的时间<br>pt: TPoint; / /消息创建时的鼠标位置<br>e n d ;<br>消息中有什么?<br>是否觉得一个消息记录中的信息像希腊语一样?如果是这样,那么看一看下面的解释:<br>hwnd 32位的窗口句柄。窗口可以是任何类型的屏幕对象,因为Win32能够维护大多数可<br>视对象的句柄(窗口、对话框、按钮、编辑框等)。<br>message 用于区别其他消息的常量值,这些常量可以是Windows单元中预定义的常量,也<br>可以是自定义的常量。<br>wParam 通常是一个与消息有关的常量值,也可能是窗口或控件的句柄。<br>lParam 通常是一个指向内存中数据的指针。由于W P a r a m、l P a r a m和P o i n t e r都是3 2位的,<br>因此,它们之间可以相互转换。<br>&nbsp; &nbsp; WM_NULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0000;<br>&nbsp; WM_CREATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0001;<br>应用程序创建一个窗口<br>&nbsp; WM_DESTROY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0002;<br>一个窗口被销毁<br>&nbsp; WM_MOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0003;<br>移动一个窗口<br>&nbsp; WM_SIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0005;<br>改变一个窗口的大小<br>&nbsp; WM_ACTIVATE &nbsp; &nbsp; &nbsp; &nbsp; = $0006;<br>一个窗口被激活或失去激活状态;<br>&nbsp; WM_SETFOCUS &nbsp; &nbsp; &nbsp; &nbsp; = $0007;<br>获得焦点后<br>&nbsp; WM_KILLFOCUS &nbsp; &nbsp; &nbsp; &nbsp;= $0008;<br>失去焦点<br>&nbsp; WM_ENABLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $000A;<br>改变enable状态<br>&nbsp; WM_SETREDRAW &nbsp; &nbsp; &nbsp; &nbsp;= $000B;<br>设置窗口是否能重画 &nbsp;<br>&nbsp; WM_SETTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $000C;<br>&nbsp;应用程序发送此消息来设置一个窗口的文本<br>&nbsp; WM_GETTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $000D;<br>&nbsp;应用程序发送此消息来复制对应窗口的文本到缓冲区<br>&nbsp; WM_GETTEXTLENGTH &nbsp; &nbsp;= $000E;<br>得到与一个窗口有关的文本的长度(不包含空字符)<br>&nbsp; WM_PAINT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $000F;<br>要求一个窗口重画自己<br>&nbsp; WM_CLOSE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0010;<br>当一个窗口或应用程序要关闭时发送一个信号<br>&nbsp; WM_QUERYENDSESSION &nbsp;= $0011;<br>当用户选择结束对话框或程序自己调用ExitWindows函数<br>&nbsp; WM_QUIT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0012;<br>用来结束程序运行或当程序调用postquitmessage函数 <br>&nbsp; WM_QUERYOPEN &nbsp; &nbsp; &nbsp; &nbsp;= $0013;<br>&nbsp;当用户窗口恢复以前的大小位置时,把此消息发送给某个图标<br>&nbsp; WM_ERASEBKGND &nbsp; &nbsp; &nbsp; = $0014;<br>&nbsp;当窗口背景必须被擦除时(例在窗口改变大小时)<br>&nbsp; WM_SYSCOLORCHANGE &nbsp; = $0015;<br>&nbsp;当系统颜色改变时,发送此消息给所有顶级窗口<br>&nbsp; WM_ENDSESSION &nbsp; &nbsp; &nbsp; = $0016;<br>&nbsp;当系统进程发出WM_QUERYENDSESSION消息后,此消息发送给应用程序,<br>通知它对话是否结束<br>&nbsp; WM_SYSTEMERROR &nbsp; &nbsp; &nbsp;= $0017;<br>&nbsp; WM_SHOWWINDOW &nbsp; &nbsp; &nbsp; = $0018;<br>&nbsp;当隐藏或显示窗口是发送此消息给这个窗口<br>&nbsp; WM_ACTIVATEAPP &nbsp; &nbsp; &nbsp;= $001C;<br>发此消息给应用程序哪个窗口是激活的,哪个是非激活的;<br>&nbsp; WM_FONTCHANGE &nbsp; &nbsp; &nbsp; = $001D;<br>当系统的字体资源库变化时发送此消息给所有顶级窗口<br>&nbsp; WM_TIMECHANGE &nbsp; &nbsp; &nbsp; = $001E;<br>&nbsp;当系统的时间变化时发送此消息给所有顶级窗口<br>&nbsp; WM_CANCELMODE &nbsp; &nbsp; &nbsp; = $001F;<br>&nbsp;发送此消息来取消某种正在进行的摸态(操作)<br>&nbsp; WM_SETCURSOR &nbsp; &nbsp; &nbsp; &nbsp;= $0020;<br>&nbsp;如果鼠标引起光标在某个窗口中移动且鼠标输入没有被捕获时,就发消息给某个窗口<br>&nbsp; WM_MOUSEACTIVATE &nbsp; &nbsp;= $0021;<br>&nbsp;当光标在某个非激活的窗口中而用户正按着鼠标的某个键发送此消息给当前窗口<br>&nbsp; WM_CHILDACTIVATE &nbsp; &nbsp;= $0022;<br>发送此消息给MDI子窗口当用户点击此窗口的标题栏,或当窗口被激活,移动,改变大小<br>&nbsp; WM_QUEUESYNC &nbsp; &nbsp; &nbsp; &nbsp;= $0023;<br>&nbsp;此消息由基于计算机的训练程序发送,通过WH_JOURNALPALYBACK的hook程序<br>分离出用户输入消息<br>&nbsp; WM_GETMINMAXINFO &nbsp; &nbsp;= $0024;<br>此消息发送给窗口当它将要改变大小或位置;<br>&nbsp; WM_PAINTICON &nbsp; &nbsp; &nbsp; &nbsp;= $0026;<br>&nbsp;发送给最小化窗口当它图标将要被重画<br>&nbsp; WM_ICONERASEBKGND &nbsp; = $0027;<br>&nbsp; 此消息发送给某个最小化窗口,仅当它在画图标前它的背景必须被重画<br>&nbsp; WM_NEXTDLGCTL &nbsp; &nbsp; &nbsp; = $0028;<br>&nbsp;发送此消息给一个对话框程序去更改焦点位置<br>&nbsp; WM_SPOOLERSTATUS &nbsp; &nbsp;= $002A;<br>&nbsp;每当打印管理列队增加或减少一条作业时发出此消息 <br>&nbsp; WM_DRAWITEM &nbsp; &nbsp; &nbsp; &nbsp; = $002B;<br>&nbsp; 当button,combobox,listbox,menu的可视外观改变时发送<br>此消息给这些空件的所有者<br>&nbsp; WM_MEASUREITEM &nbsp; &nbsp; &nbsp;= $002C;<br>&nbsp;当button, combo box, list box, list view control, or menu item 被创建时<br>发送此消息给控件的所有者<br>&nbsp; WM_DELETEITEM &nbsp; &nbsp; &nbsp; = $002D;<br>&nbsp;当the list box 或 combo box 被销毁 或 当 某些项被删除通过LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT 消息<br>&nbsp; WM_VKEYTOITEM &nbsp; &nbsp; &nbsp; = $002E;<br>此消息有一个LBS_WANTKEYBOARDINPUT风格的发出给它的所有者来响应WM_KEYDOWN消息 &nbsp;<br>&nbsp; WM_CHARTOITEM &nbsp; &nbsp; &nbsp; = $002F;<br>此消息由一个LBS_WANTKEYBOARDINPUT风格的列表框发送给他的所有者来响应WM_CHAR消息 &nbsp;<br>&nbsp; WM_SETFONT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0030;<br>当绘制文本时程序发送此消息得到控件要用的颜色 <br>&nbsp; WM_GETFONT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0031;<br>&nbsp;应用程序发送此消息得到当前控件绘制文本的字体<br>&nbsp; WM_SETHOTKEY &nbsp; &nbsp; &nbsp; &nbsp;= $0032;<br>&nbsp;应用程序发送此消息让一个窗口与一个热键相关连<br>&nbsp; WM_GETHOTKEY &nbsp; &nbsp; &nbsp; &nbsp;= $0033;<br>&nbsp;应用程序发送此消息来判断热键与某个窗口是否有关联<br>&nbsp; WM_QUERYDRAGICON &nbsp; &nbsp;= $0037;<br>此消息发送给最小化窗口,当此窗口将要被拖放而它的类中没有定义图标,应用程序能<br>返回一个图标或光标的句柄,当用户拖放图标时系统显示这个图标或光标<br>&nbsp; WM_COMPAREITEM &nbsp; &nbsp; &nbsp;= $0039;<br>发送此消息来判定combobox或listbox新增加的项的相对位置<br>&nbsp; WM_GETOBJECT &nbsp; &nbsp; &nbsp; &nbsp;= $003D;<br>&nbsp; WM_COMPACTING &nbsp; &nbsp; &nbsp; = $0041;<br>显示内存已经很少了<br>&nbsp; WM_WINDOWPOSCHANGING = $0046;<br>发送此消息给那个窗口的大小和位置将要被改变时,来调用setwindowpos函数或其它窗口管理函数<br>&nbsp; WM_WINDOWPOSCHANGED = $0047;<br>发送此消息给那个窗口的大小和位置已经被改变时,来调用setwindowpos函数或其它窗口管理函数<br>&nbsp; WM_POWER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0048;(适用于16位的windows)<br>当系统将要进入暂停状态时发送此消息<br>&nbsp; WM_COPYDATA &nbsp; &nbsp; &nbsp; &nbsp; = $004A;<br>当一个应用程序传递数据给另一个应用程序时发送此消息<br>&nbsp; WM_CANCELJOURNAL &nbsp; &nbsp;= $004B;<br>当某个用户取消程序日志激活状态,提交此消息给程序<br>&nbsp; WM_NOTIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $004E;<br>当某个控件的某个事件已经发生或这个控件需要得到一些信息时,发送此消息给它的父窗口<br>&nbsp; WM_INPUTLANGCHANGEREQUEST = $0050;<br>当用户选择某种输入语言,或输入语言的热键改变<br>&nbsp; WM_INPUTLANGCHANGE &nbsp;= $0051;<br>当平台现场已经被改变后发送此消息给受影响的最顶级窗口<br>&nbsp; WM_TCARD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0052;<br>当程序已经初始化windows帮助例程时发送此消息给应用程序<br>&nbsp; WM_HELP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0053;<br>此消息显示用户按下了F1,如果某个菜单是激活的,就发送此消息个此窗口关联的菜单,否则就<br>发送给有焦点的窗口,如果当前都没有焦点,就把此消息发送给当前激活的窗口<br>&nbsp; WM_USERCHANGED &nbsp; &nbsp; &nbsp;= $0054;<br>当用户已经登入或退出后发送此消息给所有的窗口,当用户登入或退出时系统更新用户的具体<br>设置信息,在用户更新设置时系统马上发送此消息;<br>&nbsp; WM_NOTIFYFORMAT &nbsp; &nbsp; = $0055;<br>公用控件,自定义控件和他们的父窗口通过此消息来判断控件是使用ANSI还是UNICODE结构<br>在WM_NOTIFY消息,使用此控件能使某个控件与它的父控件之间进行相互通信<br>&nbsp; WM_CONTEXTMENU &nbsp; &nbsp; &nbsp;= $007B;<br>当用户某个窗口中点击了一下右键就发送此消息给这个窗口<br>&nbsp; WM_STYLECHANGING &nbsp; &nbsp;= $007C;<br>当调用SETWINDOWLONG函数将要改变一个或多个 窗口的风格时发送此消息给那个窗口<br>&nbsp; WM_STYLECHANGED &nbsp; &nbsp; = $007D;<br>当调用SETWINDOWLONG函数一个或多个 窗口的风格后发送此消息给那个窗口<br>&nbsp; WM_DISPLAYCHANGE &nbsp; &nbsp;= $007E;<br>当显示器的分辨率改变后发送此消息给所有的窗口<br>&nbsp; WM_GETICON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $007F;<br>此消息发送给某个窗口来返回与某个窗口有关连的大图标或小图标的句柄;<br>&nbsp; WM_SETICON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0080;<br>程序发送此消息让一个新的大图标或小图标与某个窗口关联;<br>&nbsp; WM_NCCREATE &nbsp; &nbsp; &nbsp; &nbsp; = $0081;<br>当某个窗口第一次被创建时,此消息在WM_CREATE消息发送前发送;<br>&nbsp; WM_NCDESTROY &nbsp; &nbsp; &nbsp; &nbsp;= $0082;<br>此消息通知某个窗口,非客户区正在销毁<br>&nbsp; WM_NCCALCSIZE &nbsp; &nbsp; &nbsp; = $0083;<br>当某个窗口的客户区域必须被核算时发送此消息<br>&nbsp; WM_NCHITTEST &nbsp; &nbsp; &nbsp; &nbsp;= $0084;//移动鼠标,按住或释放鼠标时发生<br>&nbsp; WM_NCPAINT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0085;<br>程序发送此消息给某个窗口当它(窗口)的框架必须被绘制时;<br>&nbsp; WM_NCACTIVATE &nbsp; &nbsp; &nbsp; = $0086;<br>此消息发送给某个窗口 仅当它的非客户区需要被改变来显示是激活还是非激活状态;<br>&nbsp; WM_GETDLGCODE &nbsp; &nbsp; &nbsp; = $0087;<br>发送此消息给某个与对话框程序关联的控件,widdows控制方位键和TAB键使输入进入此控件<br>通过响应WM_GETDLGCODE消息,应用程序可以把他当成一个特殊的输入控件并能处理它<br>&nbsp; WM_NCMOUSEMOVE &nbsp; &nbsp; &nbsp;= $00A0;<br>当光标在一个窗口的非客户区内移动时发送此消息给这个窗口 &nbsp; &nbsp; &nbsp;//非客户区为:窗体的标题栏及窗 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 的边框体<br>&nbsp; WM_NCLBUTTONDOWN &nbsp; &nbsp;= $00A1;<br>当光标在一个窗口的非客户区同时按下鼠标左键时提交此消息<br>&nbsp; WM_NCLBUTTONUP &nbsp; &nbsp; &nbsp;= $00A2;<br>当用户释放鼠标左键同时光标某个窗口在非客户区十发送此消息;<br>&nbsp; WM_NCLBUTTONDBLCLK &nbsp;= $00A3;<br>当用户双击鼠标左键同时光标某个窗口在非客户区十发送此消息<br>&nbsp; WM_NCRBUTTONDOWN &nbsp; &nbsp;= $00A4;<br>当用户按下鼠标右键同时光标又在窗口的非客户区时发送此消息<br>&nbsp; WM_NCRBUTTONUP &nbsp; &nbsp; &nbsp;= $00A5;<br>当用户释放鼠标右键同时光标又在窗口的非客户区时发送此消息<br>&nbsp; WM_NCRBUTTONDBLCLK &nbsp;= $00A6;<br>当用户双击鼠标右键同时光标某个窗口在非客户区十发送此消息<br>&nbsp; WM_NCMBUTTONDOWN &nbsp; &nbsp;= $00A7;<br>当用户按下鼠标中键同时光标又在窗口的非客户区时发送此消息<br>&nbsp; WM_NCMBUTTONUP &nbsp; &nbsp; &nbsp;= $00A8;<br>当用户释放鼠标中键同时光标又在窗口的非客户区时发送此消息<br>&nbsp; WM_NCMBUTTONDBLCLK &nbsp;= $00A9;<br>当用户双击鼠标中键同时光标又在窗口的非客户区时发送此消息<br>&nbsp; WM_KEYFIRST &nbsp; &nbsp; &nbsp; &nbsp; = $0100;<br>&nbsp;WM_KEYDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0100; &nbsp; &nbsp; &nbsp;<br>&nbsp;//按下一个键<br>&nbsp; WM_KEYUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0101; &nbsp; &nbsp; &nbsp;<br>&nbsp;//释放一个键<br>&nbsp; WM_CHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0102; &nbsp; &nbsp; &nbsp;<br>&nbsp;//按下某键,并已发出WM_KEYDOWN, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WM_KEYUP消息<br>&nbsp; WM_DEADCHAR &nbsp; &nbsp; &nbsp; &nbsp; = $0103;<br>当用translatemessage函数翻译WM_KEYUP消息时发送此消息给拥有焦点的窗口<br>&nbsp; WM_SYSKEYDOWN &nbsp; &nbsp; &nbsp; = $0104;<br>当用户按住ALT键同时按下其它键时提交此消息给拥有焦点的窗口;<br>&nbsp; WM_SYSKEYUP &nbsp; &nbsp; &nbsp; &nbsp; = $0105;<br>当用户释放一个键同时ALT 键还按着时提交此消息给拥有焦点的窗口<br>&nbsp; WM_SYSCHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0106;<br>当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后提交此消息给拥有焦点的窗口<br>&nbsp; WM_SYSDEADCHAR &nbsp; &nbsp; &nbsp;= $0107;<br>当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后发送此消息给拥有焦点的窗口<br>&nbsp; WM_KEYLAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0108;<br>&nbsp; WM_INITDIALOG &nbsp; &nbsp; &nbsp; = $0110;<br>在一个对话框程序被显示前发送此消息给它,通常用此消息初始化控件和执行其它任务<br>&nbsp; WM_COMMAND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0111;<br>当用户选择一条菜单命令项或当某个控件发送一条消息给它的父窗口,一个快捷键被翻译<br>&nbsp; WM_SYSCOMMAND &nbsp; &nbsp; &nbsp; = $0112;<br>当用户选择窗口菜单的一条命令或当用户选择最大化或最小化时那个窗口会收到此消息<br>&nbsp; WM_TIMER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0113; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//发生了定时器事件<br>&nbsp; WM_HSCROLL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0114;<br>当一个窗口标准水平滚动条产生一个滚动事件时发送此消息给那个窗口,也发送给拥有它的控件<br>&nbsp; WM_VSCROLL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0115;<br>当一个窗口标准垂直滚动条产生一个滚动事件时发送此消息给那个窗口也,发送给拥有它的控件 &nbsp;WM_INITMENU &nbsp; &nbsp; &nbsp; &nbsp; = $0116;<br>当一个菜单将要被激活时发送此消息,它发生在用户菜单条中的某项或按下某个菜单键,它允许<br>程序在显示前更改菜单<br>&nbsp; WM_INITMENUPOPUP &nbsp; &nbsp;= $0117;<br>当一个下拉菜单或子菜单将要被激活时发送此消息,它允许程序在它显示前更改菜单,而不要<br>改变全部 <br>&nbsp;WM_MENUSELECT &nbsp; &nbsp; &nbsp; = $011F;<br>当用户选择一条菜单项时发送此消息给菜单的所有者(一般是窗口)<br>&nbsp; WM_MENUCHAR &nbsp; &nbsp; &nbsp; &nbsp; = $0120;<br>当菜单已被激活用户按下了某个键(不同于加速键),发送此消息给菜单的所有者;<br>&nbsp; WM_ENTERIDLE &nbsp; &nbsp; &nbsp; &nbsp;= $0121;<br>当一个模态对话框或菜单进入空载状态时发送此消息给它的所有者,一个模态对话框或菜单进入空载状态就是在处理完一条或几条先前的消息后没有消息它的列队中等待<br>&nbsp; WM_MENURBUTTONUP &nbsp; &nbsp;= $0122;<br>&nbsp; WM_MENUDRAG &nbsp; &nbsp; &nbsp; &nbsp; = $0123;<br>&nbsp; WM_MENUGETOBJECT &nbsp; &nbsp;= $0124;<br>&nbsp; WM_UNINITMENUPOPUP &nbsp;= $0125;<br>&nbsp; WM_MENUCOMMAND &nbsp; &nbsp; &nbsp;= $0126;<br>&nbsp; WM_CHANGEUISTATE &nbsp; &nbsp;= $0127;<br>&nbsp; WM_UPDATEUISTATE &nbsp; &nbsp;= $0128;<br>&nbsp; WM_QUERYUISTATE &nbsp; &nbsp; = $0129; &nbsp;<br>&nbsp; WM_CTLCOLORMSGBOX &nbsp; = $0132;<br>在windows绘制消息框前发送此消息给消息框的所有者窗口,通过响应这条消息,所有者窗口可以<br>通过使用给定的相关显示设备的句柄来设置消息框的文本和背景颜色<br>&nbsp; WM_CTLCOLOREDIT &nbsp; &nbsp; = $0133;<br>当一个编辑型控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以<br>通过使用给定的相关显示设备的句柄来设置编辑框的文本和背景颜色<br>&nbsp; WM_CTLCOLORLISTBOX &nbsp;= $0134;<br>当一个列表框控件将要被绘制前发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以<br>通过使用给定的相关显示设备的句柄来设置列表框的文本和背景颜色 <br>&nbsp;WM_CTLCOLORBTN &nbsp; &nbsp; &nbsp;= $0135;<br>当一个按钮控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以<br>通过使用给定的相关显示设备的句柄来设置按纽的文本和背景颜色<br>&nbsp; WM_CTLCOLORDLG &nbsp; &nbsp; &nbsp;= $0136;<br>当一个对话框控件将要被绘制前发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以<br>通过使用给定的相关显示设备的句柄来设置对话框的文本背景颜色<br>&nbsp; WM_CTLCOLORSCROLLBAR= $0137;<br>当一个滚动条控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以<br>通过使用给定的相关显示设备的句柄来设置滚动条的背景颜色<br>&nbsp; WM_CTLCOLORSTATIC &nbsp; = $0138; &nbsp; <br>当一个静态控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以<br>通过使用给定的相关显示设备的句柄来设置静态控件的文本和背景颜色<br>&nbsp; &nbsp;WM_MOUSEFIRST &nbsp; &nbsp; &nbsp; = $0200;<br>&nbsp; WM_MOUSEMOVE &nbsp; &nbsp; &nbsp; &nbsp;= $0200; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;移动鼠标<br>&nbsp; WM_LBUTTONDOWN &nbsp; &nbsp; &nbsp;= $0201; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //按下鼠标左键<br>&nbsp; WM_LBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp;= $0202; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//释放鼠标左键<br>&nbsp; WM_LBUTTONDBLCLK &nbsp; &nbsp;= $0203;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//双击鼠标左键<br>&nbsp; WM_RBUTTONDOWN &nbsp; &nbsp; &nbsp;= $0204;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//按下鼠标右键<br>&nbsp; WM_RBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp;= $0205;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //释放鼠标右键<br>&nbsp; WM_RBUTTONDBLCLK &nbsp; &nbsp;= $0206; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//双击鼠标右键<br>&nbsp; WM_MBUTTONDOWN &nbsp; &nbsp; &nbsp;= $0207; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//按下鼠标中键 <br>&nbsp; WM_MBUTTONUP &nbsp; &nbsp; &nbsp; &nbsp;= $0208; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//释放鼠标中键<br>&nbsp; WM_MBUTTONDBLCLK &nbsp; &nbsp;= $0209; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //双击鼠标中键<br>&nbsp; WM_MOUSEWHEEL &nbsp; &nbsp; &nbsp; = $020A;<br>当鼠标轮子转动时发送此消息个当前有焦点的控件<br>&nbsp; WM_MOUSELAST &nbsp; &nbsp; &nbsp; &nbsp;= $020A;<br>&nbsp; WM_PARENTNOTIFY &nbsp; &nbsp; = $0210;<br>当MDI子窗口被创建或被销毁,或用户按了一下鼠标键而光标在子窗口上时发送此消息给它的父窗口<br>&nbsp; WM_ENTERMENULOOP &nbsp; &nbsp;= $0211;<br>发送此消息通知应用程序的主窗口that已经进入了菜单循环模式<br>&nbsp; WM_EXITMENULOOP &nbsp; &nbsp; = $0212;<br>发送此消息通知应用程序的主窗口that已退出了菜单循环模式<br>&nbsp; WM_NEXTMENU &nbsp; &nbsp; &nbsp; &nbsp; = $0213;<br>&nbsp; WM_SIZING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 532;<br>当用户正在调整窗口大小时发送此消息给窗口;通过此消息应用程序可以监视窗口大小和位置<br>也可以修改他们<br>&nbsp; WM_CAPTURECHANGED &nbsp; = 533;<br>发送此消息 给窗口当它失去捕获的鼠标时;<br>&nbsp; WM_MOVING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 534;<br>当用户在移动窗口时发送此消息,通过此消息应用程序可以监视窗口大小和位置<br>也可以修改他们;<br>&nbsp; WM_POWERBROADCAST &nbsp; = 536;<br>此消息发送给应用程序来通知它有关电源管理事件;<br>&nbsp; WM_DEVICECHANGE &nbsp; &nbsp; = 537;<br>当设备的硬件配置改变时发送此消息给应用程序或设备驱动程序<br>&nbsp; WM_IME_STARTCOMPOSITION &nbsp; &nbsp; &nbsp; &nbsp;= $010D;<br>&nbsp; WM_IME_ENDCOMPOSITION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $010E;<br>&nbsp; WM_IME_COMPOSITION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $010F;<br>&nbsp; WM_IME_KEYLAST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $010F;<br>&nbsp; WM_IME_SETCONTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0281;<br>&nbsp; WM_IME_NOTIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0282;<br>&nbsp; WM_IME_CONTROL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0283;<br>&nbsp; WM_IME_COMPOSITIONFULL &nbsp; &nbsp; &nbsp; &nbsp; = $0284;<br>&nbsp; WM_IME_SELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0285;<br>&nbsp; WM_IME_CHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0286;<br>&nbsp; WM_IME_REQUEST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0288;<br>&nbsp; WM_IME_KEYDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0290;<br>&nbsp; WM_IME_KEYUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0291;<br>&nbsp; WM_MDICREATE &nbsp; &nbsp; &nbsp; &nbsp;= $0220;<br>应用程序发送此消息给多文档的客户窗口来创建一个MDI 子窗口<br>&nbsp; WM_MDIDESTROY &nbsp; &nbsp; &nbsp; = $0221;<br>应用程序发送此消息给多文档的客户窗口来关闭一个MDI 子窗口<br>&nbsp; WM_MDIACTIVATE &nbsp; &nbsp; &nbsp;= $0222;<br>应用程序发送此消息给多文档的客户窗口通知客户窗口激活另一个MDI子窗口,当客户窗口收到<br>此消息后,它发出WM_MDIACTIVE消息给MDI子窗口(未激活)激活它;<br>&nbsp; WM_MDIRESTORE &nbsp; &nbsp; &nbsp; = $0223;<br>程序 发送此消息给MDI客户窗口让子窗口从最大最小化恢复到原来大小<br>&nbsp; WM_MDINEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0224;<br>程序 发送此消息给MDI客户窗口激活下一个或前一个窗口<br>&nbsp; WM_MDIMAXIMIZE &nbsp; &nbsp; &nbsp;= $0225;<br>程序发送此消息给MDI客户窗口来最大化一个MDI子窗口;<br>&nbsp; WM_MDITILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0226;<br>程序 发送此消息给MDI客户窗口以平铺方式重新排列所有MDI子窗口<br>&nbsp; WM_MDICASCADE &nbsp; &nbsp; &nbsp; = $0227;<br>程序 发送此消息给MDI客户窗口以层叠方式重新排列所有MDI子窗口<br>&nbsp; WM_MDIICONARRANGE &nbsp; = $0228;<br>程序 发送此消息给MDI客户窗口重新排列所有最小化的MDI子窗口<br>&nbsp; WM_MDIGETACTIVE &nbsp; &nbsp; = $0229;<br>程序 发送此消息给MDI客户窗口来找到激活的子窗口的句柄<br>&nbsp; WM_MDISETMENU &nbsp; &nbsp; &nbsp; = $0230;<br>程序 发送此消息给MDI客户窗口用MDI菜单代替子窗口的菜单<br>&nbsp; WM_ENTERSIZEMOVE &nbsp; &nbsp;= $0231;<br>&nbsp; WM_EXITSIZEMOVE &nbsp; &nbsp; = $0232;<br>&nbsp; WM_DROPFILES &nbsp; &nbsp; &nbsp; &nbsp;= $0233;<br>&nbsp; WM_MDIREFRESHMENU &nbsp; = $0234;<br>&nbsp; WM_MOUSEHOVER &nbsp; &nbsp; &nbsp; = $02A1;<br>&nbsp; WM_MOUSELEAVE &nbsp; &nbsp; &nbsp; = $02A3;<br>&nbsp; WM_CUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0300;<br>程序发送此消息给一个编辑框或combobox来删除当前选择的文本<br>&nbsp; WM_COPY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0301;<br>程序发送此消息给一个编辑框或combobox来复制当前选择的文本到剪贴板<br>&nbsp; WM_PASTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0302;<br>程序发送此消息给editcontrol或combobox从剪贴板中得到数据<br>&nbsp; WM_CLEAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0303;<br>程序发送此消息给editcontrol或combobox清除当前选择的内容;<br>&nbsp; WM_UNDO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0304;<br>程序发送此消息给editcontrol或combobox撤消最后一次操作<br>&nbsp; WM_RENDERFORMAT &nbsp; &nbsp; = $0305;<br><br>&nbsp; WM_RENDERALLFORMATS = $0306;<br>&nbsp; WM_DESTROYCLIPBOARD = $0307;<br>当调用ENPTYCLIPBOARD函数时 发送此消息给剪贴板的所有者<br>&nbsp; WM_DRAWCLIPBOARD &nbsp; &nbsp;= $0308;<br>当剪贴板的内容变化时发送此消息给剪贴板观察链的第一个窗口;它允许用剪贴板观察窗口来<br>显示剪贴板的新内容;<br>&nbsp; WM_PAINTCLIPBOARD &nbsp; = $0309;<br>当剪贴板包含CF_OWNERDIPLAY格式的数据并且剪贴板观察窗口的客户区需要重画;<br>&nbsp; WM_VSCROLLCLIPBOARD = $030A;<br>&nbsp; WM_SIZECLIPBOARD &nbsp; &nbsp;= $030B;<br>当剪贴板包含CF_OWNERDIPLAY格式的数据并且剪贴板观察窗口的客户区域的大小已经改变是此消息通过剪贴板观察窗口发送给剪贴板的所有者;<br>&nbsp; WM_ASKCBFORMATNAME &nbsp;= $030C;<br>通过剪贴板观察窗口发送此消息给剪贴板的所有者来请求一个CF_OWNERDISPLAY格式的剪贴板的名字<br>&nbsp; WM_CHANGECBCHAIN &nbsp; &nbsp;= $030D;<br>当一个窗口从剪贴板观察链中移去时发送此消息给剪贴板观察链的第一个窗口;<br>&nbsp; WM_HSCROLLCLIPBOARD = $030E; <br>此消息通过一个剪贴板观察窗口发送给剪贴板的所有者 ;它发生在当剪贴板包含CFOWNERDISPALY格式的数据并且有个事件在剪贴板观察窗的水平滚动条上;所有者应滚动剪贴板图象并更新滚动条的值;<br>&nbsp; WM_QUERYNEWPALETTE &nbsp;= $030F;<br>此消息发送给将要收到焦点的窗口,此消息能使窗口在收到焦点时同时有机会实现他的逻辑调色板<br>&nbsp; WM_PALETTEISCHANGING= $0310;<br>当一个应用程序正要实现它的逻辑调色板时发此消息通知所有的应用程序<br>&nbsp; WM_PALETTECHANGED &nbsp; = $0311;<br>此消息在一个拥有焦点的窗口实现它的逻辑调色板后发送此消息给所有顶级并重叠的窗口,以此<br>来改变系统调色板 <br>&nbsp; WM_HOTKEY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0312;<br>当用户按下由REGISTERHOTKEY函数注册的热键时提交此消息<br>&nbsp; WM_PRINT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 791;<br>应用程序发送此消息仅当WINDOWS或其它应用程序发出一个请求要求绘制一个应用程序的一部分;<br>&nbsp; WM_PRINTCLIENT &nbsp; &nbsp; &nbsp;= 792;<br>&nbsp; WM_HANDHELDFIRST &nbsp; &nbsp;= 856;<br>&nbsp; WM_HANDHELDLAST &nbsp; &nbsp; = 863;<br>&nbsp; WM_PENWINFIRST &nbsp; &nbsp; &nbsp;= $0380;<br>&nbsp; WM_PENWINLAST &nbsp; &nbsp; &nbsp; = $038F;<br>&nbsp; WM_COALESCE_FIRST &nbsp; = $0390;<br>&nbsp; WM_COALESCE_LAST &nbsp; &nbsp;= $039F;<br>&nbsp; WM_DDE_FIRST &nbsp; &nbsp; &nbsp; &nbsp;= $03E0;<br>&nbsp; WM_DDE_INITIATE &nbsp; &nbsp; = WM_DDE_FIRST + 0;<br>一个DDE客户程序提交此消息开始一个与服务器程序的会话来响应那个指定的程序和主题名;<br>&nbsp; WM_DDE_TERMINATE &nbsp; &nbsp;= WM_DDE_FIRST + 1;<br>一个DDE应用程序(无论是客户还是服务器)提交此消息来终止一个会话;<br>&nbsp; WM_DDE_ADVISE &nbsp; &nbsp; &nbsp; = WM_DDE_FIRST + 2;<br>一个DDE客户程序提交此消息给一个DDE服务程序来请求服务器每当数据项改变时更新它<br>&nbsp; WM_DDE_UNADVISE &nbsp; &nbsp; = WM_DDE_FIRST + 3;<br>一个DDE客户程序通过此消息通知一个DDE服务程序不更新指定的项或一个特殊的剪贴板格式的项<br>&nbsp; WM_DDE_ACK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= WM_DDE_FIRST + 4;<br>此消息通知一个DDE(动态数据交换)程序已收到并正在处理WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIAT消息<br>&nbsp; WM_DDE_DATA &nbsp; &nbsp; &nbsp; &nbsp; = WM_DDE_FIRST + 5;<br>一个DDE服务程序提交此消息给DDE客户程序来传递个一数据项给客户或通知客户的一条可用数据项<br>&nbsp; WM_DDE_REQUEST &nbsp; &nbsp; &nbsp;= WM_DDE_FIRST + 6;<br>一个DDE客户程序提交此消息给一个DDE服务程序来请求一个数据项的值;<br>&nbsp; WM_DDE_POKE &nbsp; &nbsp; &nbsp; &nbsp; = WM_DDE_FIRST + 7;<br>一个DDE客户程序提交此消息给一个DDE服务程序,客户使用此消息来请求服务器接收一个未经同意的数据项;服务器通过答复WM_DDE_ACK消息提示是否它接收这个数据项;<br>&nbsp; WM_DDE_EXECUTE &nbsp; &nbsp; &nbsp;= WM_DDE_FIRST + 8;<br>一个DDE客户程序提交此消息给一个DDE服务程序来发送一个字符串给服务器让它象串行命令一样被处理,服务器通过提交WM_DDE_ACK消息来作回应;<br>&nbsp; WM_DDE_LAST &nbsp; &nbsp; &nbsp; &nbsp; = WM_DDE_FIRST + 8;<br>&nbsp; WM_APP = $8000;<br>&nbsp; WM_USER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0400;<br>此消息能帮助应用程序自定义私有消息;<br>/////////////////////////////////////////////////////////////////////<br>通知消息(Notification message)是指这样一种消息,一个窗口内的子控件发生了一些事情,需要通<br>知父窗口。通知消息只适用于标准的窗口控件如按钮、列表框、组合框、编辑框,以及Windows 95公<br>共控件如树状视图、列表视图等。例如,单击或双击一个控件、在控件中选择部分文本、操作控件的<br>滚动条都会产生通知消息。 <br>&nbsp; &nbsp; &nbsp;按扭<br>B N _ C L I C K E D &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//用户单击了按钮<br>B N _ D I S A B L E &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//按钮被禁止<br>B N _ D O U B L E C L I C K E D &nbsp; &nbsp;//用户双击了按钮<br>B N _ H I L I T E &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //用户加亮了按钮<br>B N _ PA I N T按钮应当重画<br>B N _ U N H I L I T E加亮应当去掉<br>组合框<br>C B N _ C L O S E U P组合框的列表框被关闭<br>C B N _ D B L C L K用户双击了一个字符串<br>C B N _ D R O P D O W N组合框的列表框被拉出<br>C B N _ E D I T C H A N G E用户修改了编辑框中的文本<br>C B N _ E D I T U P D AT E编辑框内的文本即将更新<br>C B N _ E R R S PA C E组合框内存不足<br>C B N _ K I L L F O C U S组合框失去输入焦点<br>C B N _ S E L C H A N G E在组合框中选择了一项<br>C B N _ S E L E N D C A N C E L用户的选择应当被取消<br>C B N _ S E L E N D O K用户的选择是合法的<br>C B N _ S E T F O C U S组合框获得输入焦点<br>编辑框<br>E N _ C H A N G E编辑框中的文本己更新<br>E N _ E R R S PA C E编辑框内存不足<br>E N _ H S C R O L L用户点击了水平滚动条<br>E N _ K I L L F O C U S编辑框正在失去输入焦点<br>E N _ M A X T E X T插入的内容被截断<br>E N _ S E T F O C U S编辑框获得输入焦点<br>E N _ U P D AT E编辑框中的文本将要更新<br>E N _ V S C R O L L用户点击了垂直滚动条消息含义<br>列表框<br>L B N _ D B L C L K用户双击了一项<br>L B N _ E R R S PA C E列表框内存不够<br>L B N _ K I L L F O C U S列表框正在失去输入焦点<br>L B N _ S E L C A N C E L选择被取消<br>L B N _ S E L C H A N G E选择了另一项<br>L B N _ S E T F O C U S列表框获得输入焦点<br><br>本人能力有限,如有不当之处,还望高手多多指教;baoxf1025@163.com<br>
 
帅呆了!!!!!!!!!!!!
 
最好归类一下,这样看太麻烦
 
kao,i fule you
 
下辈子千万别投胎成Win的窗体。你看它多累!
 
唉,亏得辛苦你了。<br><br>Delphi 中的 Message.pas <br>VC/C++ Builder 中的 windows.h<br><br>有详细的消息定义,再参考WIN32关于消息的文档,足够让你写本书。
 
马上摘抄
 
Pei Fu。有用得着时,再拿出来看看吧。谢谢了。Saving...
 
太好了,谢谢啦:)
 
好好<br>有人能告诉我如何抢回webborswer的焦点的方法吗
 
哇!做好事还给分,真是好人啊!!!
 
不错,已收藏.
 
多谢了高手!!
 
同志辛苦了!我代表党和人民谢谢你!<br><br>我还是先COPY吧……
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
804
SUNSTONE的Delphi笔记
S
后退
顶部