Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

IActiveDesktop (Interfaces)
 
.
Summary
Allows a client program to manage the desktop items and wallpaper on a local computer.

C# Definition:

[ComImport]
[Guid("F490EB00-1240-11D1-9888-006097DEACF9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IActiveDesktop
{
     [PreserveSig]
     int ApplyChanges(AD_Apply dwFlags);
     [PreserveSig]
     int GetWallpaper([MarshalAs(UnmanagedType.LPWStr)]  System.Text.StringBuilder pwszWallpaper,
               int cchWallpaper,
               int dwReserved);
     [PreserveSig]
     int SetWallpaper([MarshalAs(UnmanagedType.LPWStr)] string   pwszWallpaper, int dwReserved);
     [PreserveSig]
     int GetWallpaperOptions(ref WALLPAPEROPT pwpo, int dwReserved);
     [PreserveSig]
     int SetWallpaperOptions(ref WALLPAPEROPT pwpo, int dwReserved);
     [PreserveSig]
     int GetPattern([MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pwszPattern, int cchPattern, int dwReserved);
     [PreserveSig]
     int SetPattern([MarshalAs(UnmanagedType.LPWStr)] string pwszPattern, int dwReserved);
     [PreserveSig]
     int GetDesktopItemOptions(ref COMPONENTSOPT pco, int dwReserved);
     [PreserveSig]
     int SetDesktopItemOptions(ref COMPONENTSOPT pco, int dwReserved);
     [PreserveSig]
     int AddDesktopItem(ref COMPONENT pcomp, int dwReserved);
     [PreserveSig]
     int AddDesktopItemWithUI(IntPtr hwnd, ref COMPONENT pcomp, DtiAddUI dwFlags);
     [PreserveSig]
     int ModifyDesktopItem(ref COMPONENT pcomp, ComponentModify dwFlags);
     [PreserveSig]
     int RemoveDesktopItem(ref COMPONENT pcomp, int dwReserved);
     [PreserveSig]
     int GetDesktopItemCount(out int lpiCount, int dwReserved);
     [PreserveSig]
     int GetDesktopItem(int nComponent, ref COMPONENT pcomp, int dwReserved);
     [PreserveSig]
     int GetDesktopItemByID(IntPtr dwID, ref COMPONENT pcomp, int dwReserved);
     [PreserveSig]
     int GenerateDesktopItemHtml([MarshalAs(UnmanagedType.LPWStr)] string pwszFileName, ref COMPONENT pcomp, int dwReserved);
     [PreserveSig]
     int AddUrl(IntPtr hwnd, [MarshalAs(UnmanagedType.LPWStr)] string pszSource, ref COMPONENT pcomp, AddURL dwFlags);
     [PreserveSig]
     int GetDesktopItemBySource([MarshalAs(UnmanagedType.LPWStr)] string pwszSource, ref COMPONENT pcomp, int dwReserved);

}

VB Definition:

<ComImport> _
<Guid("TODO")> _
'TODO: Insert <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ if this doesn't derive from IDispatch
Interface IActiveDesktop
   TODO
End Interface

User-Defined Types:

None.

Notes:

static readonly Guid CLSID_ActiveDesktop = new Guid("{75048700-EF1F-11D0-9888-006097DEACF9}");

public static IActiveDesktop GetActiveDesktop()
{
     Type typeActiveDesktop = Type.GetTypeFromCLSID(CLSID_ActiveDesktop);
     return (IActiveDesktop) Activator.CreateInstance(typeActiveDesktop);
}

COMPONENTSOPT opts = new COMPONENTSOPT();
opts.dwSize = COMPONENTSOPT.SizeOf;
IActiveDesktop dt = GetActiveDesktop();
dt.GetDesktopItemOptions( ref opts, 0 );

Comments:

Add StaThread attribute to main application, for correct functionality

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions