本文整理自网络,侵删。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
hwins:dword;
rets:boolean;
begin
hwins:=FindWindow(nil,'新建 文本文档.txt - 记事本');
rets:=SetWindowText(hwins,'修改成功了!');
if rets=false then
label1.Caption :='修改失败!'
else
label1.caption :='修改成功!'
end;
end.
相关阅读 >>
Delphi中使用内联变量(inline variables) 的5个理由
Delphi webbrowser不能复制粘贴问题的解决办法
Delphi [数据库连接字符串] access 连接字符串
更多相关阅读请进入《Delphi》频道 >>