如何拦截系统的wm_paint消息,听说要通过WH_CALLWNDPROC的hook实现,
主要是想得到桌面刷新或重画的消息。
请写出必要的代码,先谢了!
主要是想得到桌面刷新或重画的消息。
请写出必要的代码,先谢了!
解决方案 »
- 如何清除工程文件里的无效引用呀?
- TClientDataSet老提示不在编辑状态真是见鬼了
- 怎么在WWDBGrid中将数据库中的以二进制形式保存的JPG格式图片显示出来??? 急急急!!!在线等!!!
- 谈谈delphi的多线程
- 谁能提供Leadtools下载,要有VCL,能处理DICOM文件
- 急!急!急!存储过程控件如何取多结果集,当执行正确时取返回值
- 如何实现连接到某个网站?
- DBGrid如何进行排序?
- 高分求一个拆分字符串的算法!
- 如何改变整个系统中文字的字体?
- 如何拦截系统的wm_paint消息
- 使用时发生的问题:'Query1: CommandText does not return a result set'
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure MyMessage(var Msg: TMsg; var Handled: Boolean) ;
public
{ Public declarations }
end;var
Form1: TForm1 ;
i : Integer ;implementation{$R *.dfm}procedure TForm1.MyMessage(var Msg : TMsg ;var Handled : Boolean) ;
begin
Inc(i) ;
if Msg.message = WM_Paint then
if (i mod 2) = 0 then
Caption := 'WM_Paint'
Else
Caption := 'Paint_WM' ;
end ;procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := MyMessage ;
end;end.
procedure WMpaint(var Msg:TMessage);message WM_paint;
{ Private declarations }
public
{ Public declarations }
end;
procedure TfrmMain.WMSyscommand(var Msg:Tmessage);
begin
inherited;
if msg.wParam=要的拦消息 then 做什么事..
end;
private
procedure WMpaint(var Msg:TMessage);message WM_paint;
{ Private declarations }
public
{ Public declarations }
end;
procedure TfrmMain.WMpaint(var Msg:Tmessage);
begin
inherited;
if msg.wParam=要的拦消息 then 做什么事..
end;