uses shlobj,comobj;
{ 打开活动桌面 }
function SetActiveDesktop(const b: Boolean): integer;
var
Desktop: IActiveDesktop;
Info: TComponentsOpt;
begin
DeskTop := CreateComObject(CLSID_ActiveDesktop) as IActiveDesktop;
Result := GetLastError;
info.dwSize := sizeof(info);
info.fActiveDesktop := b;
info.fEnableComponents := false;
Desktop.SetDesktopItemOptions(info, 0);
DeskTop.ApplyChanges(AD_APPLY_ALL);
end;