T
tymy
Unregistered / Unconfirmed
GUEST, unregistred user!
我是一个DELPHI的初学者,我在电脑报上看到一个小程序,是用来控制WINDOWS任务栏的隐藏和显示的。但在编译时遇到了问题,请帮我解决。现附源程序如下:
unit startbar;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,stdctrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ret:hwnd;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
setwindowpos(ret,0,0,0,0,0,swp_hidewindow);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
setwindowpos(ret,0,0,0,0,0,swp_showwindow);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ret:=findwindow('Shell_trayhwnd',");
end;
end.
unit startbar;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,stdctrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ret:hwnd;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
setwindowpos(ret,0,0,0,0,0,swp_hidewindow);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
setwindowpos(ret,0,0,0,0,0,swp_showwindow);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ret:=findwindow('Shell_trayhwnd',");
end;
end.