模拟鼠标点击 查找窗口标题


本文整理自网络,侵删。

 unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var ddphwnd:hwnd ;
begin
ddphwnd:=findwindow(nil,'标题');
//获取窗口句柄
sendmessage(ddphwnd,messages.WM_LBUTTONDOWN,0,$0183017F); //单击
sendmessage(ddphwnd,messages.WM_LBUTTONUP,0,$0183017F); //弹起

end;

end.

相关阅读 >>

Delphi检查字符串是否为纯数字

Delphi命令行窗口实现9*9乘法表

Delphi 简单电池电量显示

Delphi textfile utf8编码读写

Delphi判断驱动器类型

Delphi 方法的类型

Delphi d10.x 安卓app开发中按返回键后程序不退出程序的方法

Delphi线程简单创建、挂起、激活与终止

Delphi 阿拉伯数字转中文汉字数字

Delphi xe2获取文件的 md5、crc、sha-1、sha-256、sha-512

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...