本文整理自网络,侵删。
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 d10.x 安卓app开发中按返回键后程序不退出程序的方法
Delphi xe2获取文件的 md5、crc、sha-1、sha-256、sha-512
更多相关阅读请进入《Delphi》频道 >>