作者: | 来源:互联网 | 2023-08-31 19:49
隐藏任务栏和桌面图标unitMainUnit;Downloadbyhttp:www.codefans.netinterfaceusesWindows,Messages,SysU
//隐藏任务栏和桌面图标
unit MainUnit;
//Download by http://www.codefans.net
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TMainForm = class(TForm)
RadioGroup1:
TRadioGroup;
RadioGroup2:
TRadioGroup;
RadioGroup3:
TRadioGroup;
RadioGroup4:
TRadioGroup;
procedure RadioGroup1Click(Sender:
TObject);
procedure RadioGroup2Click(Sender:
TObject);
procedure RadioGroup3Click(Sender:
TObject);
procedure RadioGroup4Click(Sender:
TObject);
procedure FormActivate(Sender:
TObject);
private
{ Private declarations
}
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.DFM}
procedure TMainForm.RadioGroup1Click(Sender: TObject);
var
hTask: THandle;
begin
hTask:= FindWindow(‘Shell_TrayWnd‘,
nil);
if RadioGroup1.ItemIndex= 0 then
ShowWindow(hTask, SW_HIDE)
else
ShowWindow(hTask, SW_SHOW);
end;
procedure TMainForm.RadioGroup2Click(Sender: TObject);
var
hDesktop: THandle;
begin
hDesktop:= FindWindow(‘ProgMan‘,
nil);
if RadioGroup2.ItemIndex= 0 then
ShowWindow(hDesktop, SW_HIDE)
else
ShowWindow(hDesktop, SW_SHOW);
end;
procedure TMainForm.RadioGroup3Click(Sender: TObject);
var
hTask, hButton: THandle;
begin
hTask:= FindWindow(‘Shell_Traywnd‘,
nil);
hButton:= FindWindowEx(hTask, 0, ‘Button‘, nil);
if
RadioGroup3.ItemIndex= 0 then
ShowWindow(hButton,
SW_HIDE)
else
ShowWindow(hButton,
SW_SHOW);
end;
procedure TMainForm.RadioGroup4Click(Sender: TObject);
var
hTask, hTIcon: THandle;
begin
hTask:= FindWindow(‘Shell_Traywnd‘,
nil);
hTIcon:= FindWindowEx(hTask, 0, ‘ReBarWindow32‘, nil);
if RadioGroup4.ItemIndex= 0 then
ShowWindow(hTIcon,
SW_HIDE)
else
ShowWindow(hTIcon,
SW_SHOW);
end;
end.