delphi 检测桌面是否存在  
官方Delphi 学习QQ群: 682628230(三千人)\n
频道

delphi 检测桌面是否存在


function GetShellWindow:HWND;stdcall;

    external user32 Name 'GetShellWindow';




// detect desktop is present

// those are different on specific conditions, like slideshow, win10 special features, and maybe third party tools installed for desktop handling

function IsDesktopWindow(AHandle: HWND): Boolean;

var

  AppClassName: array[0..255] of char;

  ChildHwnd: HWND;

begin

  Result := False;

  if AHandle = GetDesktopWindow then Result := True

  else if AHandle = GetShellWindow then Result := True

  else

  begin

    GetClassName(AHandle, AppClassName, 255);

    if AppClassName = 'WorkerW' then

    begin

      // it should have a children with 'SHELLDLL_DefView' present

      ChildHwnd := FindWindowEx(AHandle, 0, 'SHELLDLL_DefView', nil);

      if ChildHwnd <> 0 then

      begin

        //if DetectFullScreenApp(AHandle) then

        Result := True;

      end;

    end;

  end;

end;



推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.17172980308533 seconds