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


本文整理自网络,侵删。

 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 不重复运行外部程序exe

Delphi 采用 tidhttp 访问 https 的网站,采用 tidtcpclient 访问 https 的网站

Delphi 关闭指定窗口标题的窗口

Delphi中message消息的使用方法

Delphi 实现代码重启android app

Delphi google text to speech api

Delphi 延时的4种方法

Delphi中建议使用的语句

Delphi 处理以逗号分隔的长字符串

Delphi debug和release区别

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



打赏

取消

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

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

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

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

评论

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