delphi 隐藏桌面图标和任务栏


本文整理自网络,侵删。

 隐藏桌面图标和任务栏
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

{初始化}
procedure TForm1.FormCreate(Sender: TObject);
begin
CheckBox1.Caption := '隐藏桌面图标';
CheckBox2.Caption := '隐藏任务栏';
end;

{隐藏或显示桌面图标}
procedure TForm1.CheckBox1Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow('Progman', nil); {Progman 是桌面窗口的类名}
if TCheckBox(Sender).Checked then
ShowWindow(h, SW_HIDE)
else
ShowWindow(h, SW_RESTORE);
end;

{隐藏或显示任务栏}
procedure TForm1.CheckBox2Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow('Shell_TrayWnd', nil); {Shell_TrayWnd 是任务栏窗口的类名}
if TCheckBox(Sender).Checked then
ShowWindow(h, SW_HIDE)
else
ShowWindow(h, SW_RESTORE);
end;

end.

相关阅读 >>

Delphi 颜色表

Delphi twebbrowser也能响应回车键

Delphi 的链式代码

Delphi antiemupeb

Delphi isipadress 非正则表达式验证ip的方法

Delphi 24位真彩色图形转化为ico文件

Delphi 比较完整的listview1用法

Delphi中实现dll文件自动注册

Delphi研究之驱动开发篇(五)--使用后备列表

Delphi判断线程是否释放

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...