Rediger

Del via


Win32_Desktop class

The Win32_DesktopWMI class represents the common characteristics of a user's desktop. The properties of this class can be modified by the user to customize the desktop.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax

[Dynamic, Provider("CIMWin32"), Privileges("SeRestorePrivilege"), UUID("{8502C4E3-5FBB-11D2-AAC1-006008C78BC7}"), AMENDMENT]
class Win32_Desktop : CIM_Setting
{
  string  Caption;
  string  Description;
  string  SettingID;
  uint32  BorderWidth;
  boolean CoolSwitch;
  uint32  CursorBlinkRate;
  boolean DragFullWindows;
  uint32  GridGranularity;
  uint32  IconSpacing;
  string  IconTitleFaceName;
  uint32  IconTitleSize;
  boolean IconTitleWrap;
  string  Name;
  string  Pattern;
  boolean ScreenSaverActive;
  string  ScreenSaverExecutable;
  boolean ScreenSaverSecure;
  uint32  ScreenSaverTimeout;
  string  Wallpaper;
  boolean WallpaperStretched;
  boolean WallpaperTiled;
};

Members

The Win32_Desktop class has these types of members:

Properties

The Win32_Desktop class has these properties.

BorderWidth

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop\\WindowMetrics|BorderWidth")

Width of the borders around all windows with adjustable borders.

Example: 3

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

Short textual description of the current object.

This property is inherited from CIM_Setting.

CoolSwitch

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Control Panel\\Desktop|CoolSwitch")

Fast task switching is turned on. Fast task switching allows the user to switch between windows using the ALT+TAB keyboard combination.

CursorBlinkRate

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Control Panel\\Desktop|CursorBlinkRate"), Units ("milliseconds")

Length of time between successive cursor blinks.

Example: 530

Description

Data type: string

Access type: Read-only

Textual description of the current object.

This property is inherited from CIM_Setting.

DragFullWindows

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Control Panel\\Desktop|DragFullWindows")

Contents of a window are shown when a user moves the window.

GridGranularity

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Control Panel\\Desktop|GridGranularity"), Units ("8 pixels")

Spacing of the grid that windows are bound to on the desktop. This makes organizing windows easier. The spacing is usually fine enough that the user does not notice it.

Example: 1

IconSpacing

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop\\WindowMetrics|IconSpacing"), Units ("pixels")

Spacing between icons.

Example: 75

IconTitleFaceName

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop\\WindowMetrics|IconFont")

Font used for the names of the icons.

Example: "MS San Serif"

IconTitleSize

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Font and Text Structures|LOGFONTW|lfHeight"), Units ("point")

Icon font size.

Example: 9

IconTitleWrap

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop\\WindowMetrics|IconTitleWrap")

Icon's title text wraps to the next line.

Name

Data type: string

Access type: Read-only

Qualifiers: key, MappingStrings ("WMI")

Name that identifies the current desktop profile.

Example: "MainProf"

Pattern

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|Pattern")

Name of the pattern used as the background for the desktop.

ScreenSaverActive

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|ScreenSaveActive")

Screen saver is active.

ScreenSaverExecutable

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|SCRNSAVE.EXE")

Name of the current screen saver executable file.

Example: "LOGON.SCR"

ScreenSaverSecure

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|ScreenSaverIsSecure")

Password is enabled for the screen saver.

ScreenSaverTimeout

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|ScreenSaveTimeOut"), Units ("seconds")

Amount of time that passes before the screen saver starts.

SettingID

Data type: string

Access type: Read-only

Qualifiers: MaxLen (256)

Identifier by which the current object is known.

This property is inherited from CIM_Setting.

Wallpaper

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|Wallpaper")

File name for the wallpaper design on the background of the desktop.

Example: "WINNT.BMP"

WallpaperStretched

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|WallpaperStyle")

Wallpaper is stretched to fill the entire screen. Microsoft Plus! must be installed before this option is available. If FALSE, the wallpaper retains its original dimensions on the desktop background.

WallpaperTiled

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|.DEFAULT\\Control Panel\\Desktop|TileWallpaper")

Wallpaper is tiled or centered.

Remarks

The Win32_Desktop class is derived from CIM_Setting.

The calling process that uses this class must have the SE_RESTORE_NAME privilege on the computer in which the registry resides. For example, if you enumerate this class on the local computer, the account under which your application runs must have this privilege. For more information, see Executing Privileged Operations.

Examples

The following code sample describes how to retrieve desktop information.

$desktops = Get-WmiObject win32_desktop

"This system has {0} desktop objects" -f $desktops.length
Foreach ($dt in $desktops) {
"Desktop {0}" -f $i++
"  BorderWidth           : {0}" -f $dt.BorderWidth 
"  Caption               : {0}" -f $dt.Caption
"  CoolSwitch            : {0}" -f $dt.CoolSwitch
"  CursorBlinkRate       : {0}" -f $dt.CursorBlinkRate
"  Description           : {0}" -f $dt.Description 
"  DragFullWindows       : {0}" -f $dt.DragFullWindows
"  GridGranularity       : {0}" -f $dt.GridGranularity 
"  IconSpacing           : {0}" -f $dt.IconSpacing
"  IconTitleFaceName     : {0}" -f $dt.IconTitleFaceName
"  IconTitleSize         : {0}" -f $dt.IconTitleSize
"  IconTitleWrap         : {0}" -f $dt.conTitleWrap
"  Name                  : {0}" -f $dt.Name
"  Pattern               : {0}" -f $dt.Pattern 
"  ScreenSaverActive     : {0}" -f $dt.ScreenSaverActive
"  ScreenSaverExecutable : {0}" -f $dt.ScreenSaverExecutable
"  ScreenSaverSecure     : {0}" -f $dt.creenSaverSecure
"  ScreenSaverTimeout    : {0}" -f $dt.ScreenSaverTimeout
"  SettingID             : {0}" -f $dt.SettingID
"  Wallpaper             : {0}" -f $dt.Wallpaper
"  WallpaperStretched    : {0}" -f $dt.WallpaperStretched
"  WallpaperTiled        : {0}" -f $dt.WallpaperTiled
""
}

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
CIMWin32.mof
DLL
CIMWin32.dll

See also

CIM_Setting

Operating System Classes