鼠标进入与离开的消息(覆盖CM_MOUSEENTER与CM_MOUSELEAVE消息)——Windows本身没有这样的消息
2015-12-02 06:45
513 查看
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Button1: TButton; Edit1: TEdit; private { Private declarations } procedure CMMouseEnter(var Msg: TMessage); message CM_MOUSEENTER; procedure CMMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.CMMouseEnter(var Msg: TMessage); var anObject : TObject; begin anObject := TObject(Msg.lParam); //进入控件 if anObject <> nil then begin Label1.Caption := 'Mouse Enter...'; //显示信息 end; end; procedure TForm1.CMMouseLeave(var Msg: TMessage); //退出控件 var anObject : TObject; begin anObject := TObject(Msg.lParam); if anObject <> nil then begin Label1.Caption := 'Mouse Leave...'; //显示信息 end; end; end.
http://blog.csdn.net/diligentcatrich/article/details/7010488
相关文章推荐
- JavaScript使用DeviceOne开发实战(三)仿微信应用
- 线程中的异常处理——怪不得所有的语句,都用try catch包的严严实实,甚至每个小步骤还要单独包起来
- Delphi中运行时改变panel的位置及大小(WM_SysCommand消息配合参数使用,很奇妙) good
- UITableView取消选中颜色、常用操作
- Delphi判断一个文件是不是JPG图片
- delphi中覆盖最大化消息(WM_GETMINMAXINFO)
- IntelliJ IDEA 部署Tomcat及创建一个web工程
- Delphi中TWebBrowser中注入Js
- Swift-控制流
- delphi写的整合汇编与api的简单的窗口程序
- Objecetive-C PK Swift
- Swift - 重要知识点总结
- Delphi中methodaddress的汇编代码解析
- delphi程序设计之底层原理
- Delphi中TFlowPanel实现滚动条效果
- Delphi组件开发-在窗体标题栏添加按钮(使用MakeObjectInstance(NewWndProc),并处理好多消息)
- 251. Flatten 2D Vector
- AngularJS Best Practices: SEO
- 减小Delphi的Exe文件大小(11种方法)
- Safari 下用 "location.href = filePath" 实现下载功能的诡异 bug