Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Active Desktop aktivieren (https://www.delphipraxis.net/15811-active-desktop-aktivieren.html)

mumu 4. Feb 2004 14:09


Active Desktop aktivieren
 
Hi!

weiß jemand, wie man den Active Desktop mit Delphi aktivieren bzw. deaktivieren kann?

danke schonmal

mumu 5. Feb 2004 10:44

Re: Active Desktop aktivieren
 
also ich bin jetzt selbst auf die lösung gekommen. Falls es einem Interessiert hier ein Beispielcode:
Delphi-Quellcode:
function AkivierenActiveDesktop(activate: boolean): Boolean;
const
  CLSID_AD: TGUID = '{75048700-EF1F-11D0-9888-006097DEACF9}';
var
  hObject: IUnknown;
  AD: IActiveDesktop;
  ComponentsOpt: TComponentsOpt;
begin
  hObject := CreateComObject(CLSID_AD);
  AD := hObject as IActiveDesktop;
  try
    ComponentsOpt.dwSize:=SizeOf(ComponentsOpt);
    AD.GetDesktopItemOptions(ComponentsOpt,0);
    ComponentsOpt.fActiveDesktop:=activate;
    AD.SetDesktopItemOptions(ComponentsOpt,0);
    AD.ApplyChanges(AD_APPLY_ALL or AD_APPLY_FORCE);
  finally
  end;
end;

Jens Schumann 5. Feb 2004 11:43

Re: Active Desktop aktivieren
 
Hallo,
wenn Du noch verrätst was TComponentsOpt ist, dann könnet man Deine Lösung auch nachvollziehen.

mumu 5. Feb 2004 11:56

Re: Active Desktop aktivieren
 
Dazu ein Auszug aus der MSDN.

Zitat:

COMPONENTSOPT Structure

--------------------------------------------------------------------------------

Contains the desktop item options.

Syntax

typedef struct _tagCOMPONENTSOPT {
DWORD dwSize;
BOOL fEnableComponents;
BOOL fActiveDesktop;
} COMPONENTSOPT;
Members

dwSize
DWORD value that contains the size of the structure.
fEnableComponents
BOOL value that determines if desktop items are enabled.
fActiveDesktop
BOOL value that determines if the Active Desktop is enabled.
Structure Information

Header shlobj.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:14 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz