unit1.pas
来自「delhpi经典游戏程序设计40例,大家不防下载看看.源码全在项目文件里!」· PAS 代码 · 共 41 行
PAS
41 行
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i:hwnd; //先定义一个句柄变量
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
i:=findwindow(nil,'我的电脑'); //这句话是捕捉标题为的我的电脑的句柄
showwindow(i,sw_hide);//让标题为我的电脑的窗口隐了 试试看吧 不见了吧
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
showwindow(i,sw_show); //这句是让刚才的窗口还原,显示出来
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?