Delphi 如何确定活动桌面是否已启用


本文整理自网络,侵删。

 
Unit1;
 
 interface
 
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, StdCtrls;
 
 type
   TForm1 = class(TForm)
     Button1: TButton;
     procedure Button1Click(Sender: TObject);
   private
     { Private declarations }
   public
   function IsActiveDeskTopOn:Boolean;
     { Public declarations }
   end;
 
 var
   Form1: TForm1;
 
 implementation
 
 {$R *.dfm}
 function TForm1.IsActiveDeskTopOn:Boolean;
 var
   Hd: HWND;
 begin
   Result := False;
   Hd := FindWindow( Pchar('Progman'), nil);
   Hd := FindWindowEx( hd, 0, 'SHELLDLL_DefView', nil);
   Hd := FindWindowEx( hd, 0, 'Internet Explorer_Server', nil);
   if hd = 0 then
     Result := False
   else
     Result := True;
 end;

 procedure TForm1.Button1Click(Sender: TObject);
 begin
 if IsActiveDeskTopOn then
  showmessage('Active Desktop is ON')
 else
  showmessage('Active Desktop is OFF');
 end;
 
 end.
 

相关阅读 >>

Delphi 如何遍历整个硬盘的各个目录,就像windows的查找功能那样

Delphi的对象注销方法destroy和free的区别

Delphi 获取外部程序句柄与发送消息

Delphi 判断特定字符是为单字节还是双字节

Delphi 按字符串长度对tstringlist的元素进行排序

Delphi 查找指定目录,指定扩展名的所有文件名

Delphi 拖动文件到exe 打开 获取getcommandline命令行

Delphi二分查找算法(预排序数组的查找)

Delphi xe android platform uses-permission[2] androidmanifest.xml 配置

Delphi combobox1dropdown 生成动态下拉列表

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



打赏

取消

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

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

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

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

评论

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