摘 要:如何用一个程序截获管理Windows的消息
关键字:Windows 消息 监听 列表
类 别:系统控制
{ 这个例子定义的程序可以收取所有发往主窗口的消息 }
Unit TesteandoEsta;
Interface
Uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, Menus;
Type
TForm1 = Class (TForm)
Private {Private declarations}
Public {Public declarations}
Procedure WinMsg (Var Msg : TMsg; Var Handled : Boolean);
End;
Var
Form1 : TForm1;
Implementation
{$R *.DFM}
{ 所有发送到主窗体的消息,保存在变量Msg中。 }
Procedure TForm1.WinMsg (Var Msg : TMsg; Var Handled : Boolean);
Begin
If Msg.Message = WM_SYSCOMMAND Then Beep;
{ 接收到消息时的通知}
End;
Procedure TForm1.FormCreate (Sender : TObject);
Begin
Application.OnMessage := WinMsg;
{ 替换消息句炳}
End;
- 个人资料
- 访问:85823次
- 积分:1785分
- 排名:第5311名
- 原创:86篇
- 转载:6篇
- 译文:1篇
- 评论:26条
- 文章搜索
- 文章分类
- ABC(6)
- C/C++(5)
- Computer Science(2)
- Data Structure & Algorithm(4)
- Delphi(7)
- Digest(3)
- Exams(4)
- IT Living(2)
- Linux/Unix(3)
- News(4)
- Others(5)
- Others(1)
- Perl(1)
- Resources(6)
- Script(2)
- Software Engineering(1)
- Software Engineering(5)
- Source Code(5)
- Tcl/Tk(2)
- Tcl/Tk(2)
- Tools(1)
- Visual Basic(27)
- Visual C++(6)
- Win32ASM(5)
- Windows/.NET(2)
- javascript(1)
- 文章存档
- 2011年10月(1)
- 2008年09月(1)
- 2008年04月(1)
- 2008年03月(1)
- 2008年02月(1)
- 2007年12月(1)
- 2007年11月(3)
- 2007年08月(1)
- 2007年07月(1)
- 2007年06月(1)
- 2007年05月(1)
- 2006年09月(1)
- 2006年08月(2)
- 2006年06月(1)
- 2006年03月(1)
- 2006年02月(2)
- 2006年01月(4)
- 2005年12月(5)
- 2005年11月(1)
- 2005年10月(1)
- 2005年02月(5)
- 2005年01月(9)
- 2004年12月(6)
- 2004年11月(3)
- 2004年10月(3)
- 2001年09月(32)
- 2001年08月(4)
- 阅读排行
- Tcl学习笔记(2161)
- vi命令一览表(2157)
- [译]获取系统网络MAC地址的三种方法(1807)
- UNIX Shell Commands List(1705)
- 析异XSLT处理器(1651)
- Josephus问题(1567)
- [FW]Object-Oriented Language: Tcl/Tk(1508)
- 二进制文件 VS 文本文件(1502)
- Tcl/iTcl/Tk References(1488)
- 关于pointer-to-member的一些讨论(1474)
- 评论排行
- 推荐文章
- 最新评论
-
获取快捷方式的目标和参数
BIBIHAHA:
看不明白那 -
[C++想当然]线程不安全的local static variable
zhuixundelang:
搞错了。这是很久以前的帖子了 -
[C++想当然]线程不安全的local static variable
zhuixundelang:
貌似 __cxa_guard_acquire 已经保证了 线程之间的互斥方了呀?? -
GOOGLE面试题--我的答案
gfcs19840222:
其实found(0)之后只用下面一句即可。scan(1,MAX); -
CSDN08上海熊熊会
Raptor:
BS三火 -
UNIX Shell Commands List
ari:
已阅! -
二进制文件 VS 文本文件
firetoucher:
丢人鸟~
上面是网上的,不是欧写的。放在这里只是为了方便。 -
二进制文件 VS 文本文件
ari:
不错,英语有长进 -
关于pointer-to-member的一些讨论
firetoucher:
多谢楼上关注。首先说说printf中的%p描述符。
按C99标准所说
1 The argumen... -
关于pointer-to-member的一些讨论
非典型秃子:
>1. printf 的问题我认为是Borland C++的一个bug。无论是4字节入栈还是8...
- Borland CPP Builder
- Borland Delphi
- Microsoft Visual Studio
- Others
- Stream Media
- Tech. Blog