SystemInformation Class
TOC
Collapse the table of content
Expand the table of content

SystemInformation Class

 

Provides information about the current system environment.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

System.Object
  System.Windows.Forms.SystemInformation

public class SystemInformation

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticActiveWindowTrackingDelay

Gets the active window tracking delay.

System_CAPS_pubpropertySystem_CAPS_staticArrangeDirection

Gets a value that indicates the direction in which the operating system arranges minimized windows.

System_CAPS_pubpropertySystem_CAPS_staticArrangeStartingPosition

Gets an ArrangeStartingPosition value that indicates the starting position from which the operating system arranges minimized windows.

System_CAPS_pubpropertySystem_CAPS_staticBootMode

Gets a BootMode value that indicates the boot mode the system was started in.

System_CAPS_pubpropertySystem_CAPS_staticBorder3DSize

Gets the thickness, in pixels, of a three-dimensional (3-D) style window or system control border.

System_CAPS_pubpropertySystem_CAPS_staticBorderMultiplierFactor

Gets the border multiplier factor that is used when determining the thickness of a window's sizing border.

System_CAPS_pubpropertySystem_CAPS_staticBorderSize

Gets the thickness, in pixels, of a flat-style window or system control border.

System_CAPS_pubpropertySystem_CAPS_staticCaptionButtonSize

Gets the standard size, in pixels, of a button in a window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticCaptionHeight

Gets the height, in pixels, of the standard title bar area of a window.

System_CAPS_pubpropertySystem_CAPS_staticCaretBlinkTime

Gets the caret blink time.

System_CAPS_pubpropertySystem_CAPS_staticCaretWidth

Gets the width, in pixels, of the caret in edit controls.

System_CAPS_pubpropertySystem_CAPS_staticComputerName

Gets the NetBIOS computer name of the local computer.

System_CAPS_pubpropertySystem_CAPS_staticCursorSize

Gets the maximum size, in pixels, that a cursor can occupy.

System_CAPS_pubpropertySystem_CAPS_staticDbcsEnabled

Gets a value indicating whether the operating system is capable of handling double-byte character set (DBCS) characters.

System_CAPS_pubpropertySystem_CAPS_staticDebugOS

Gets a value indicating whether the debug version of USER.EXE is installed.

System_CAPS_pubpropertySystem_CAPS_staticDoubleClickSize

Gets the dimensions, in pixels, of the area within which the user must click twice for the operating system to consider the two clicks a double-click.

System_CAPS_pubpropertySystem_CAPS_staticDoubleClickTime

Gets the maximum number of milliseconds that can elapse between a first click and a second click for the OS to consider the mouse action a double-click.

System_CAPS_pubpropertySystem_CAPS_staticDragFullWindows

Gets a value indicating whether the user has enabled full window drag.

System_CAPS_pubpropertySystem_CAPS_staticDragSize

Gets the width and height of a rectangle centered on the point the mouse button was pressed, within which a drag operation will not begin.

System_CAPS_pubpropertySystem_CAPS_staticFixedFrameBorderSize

Gets the thickness, in pixels, of the frame border of a window that has a caption and is not resizable.

System_CAPS_pubpropertySystem_CAPS_staticFontSmoothingContrast

Gets the font smoothing contrast value used in ClearType smoothing.

System_CAPS_pubpropertySystem_CAPS_staticFontSmoothingType

Gets the current type of font smoothing.

System_CAPS_pubpropertySystem_CAPS_staticFrameBorderSize

Gets the thickness, in pixels, of the resizing border that is drawn around the perimeter of a window that is being drag resized.

System_CAPS_pubpropertySystem_CAPS_staticHighContrast

Gets a value indicating whether the user has enabled the high-contrast mode accessibility feature.

System_CAPS_pubpropertySystem_CAPS_staticHorizontalFocusThickness

Gets the thickness of the left and right edges of the system focus rectangle, in pixels.

System_CAPS_pubpropertySystem_CAPS_staticHorizontalResizeBorderThickness

Gets the thickness of the left and right edges of the sizing border around the perimeter of a window being resized, in pixels.

System_CAPS_pubpropertySystem_CAPS_staticHorizontalScrollBarArrowWidth

Gets the width, in pixels, of the arrow bitmap on the horizontal scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticHorizontalScrollBarHeight

Gets the default height, in pixels, of the horizontal scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticHorizontalScrollBarThumbWidth

Gets the width, in pixels, of the scroll box in a horizontal scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticIconHorizontalSpacing

Gets the width, in pixels, of an icon arrangement cell in large icon view.

System_CAPS_pubpropertySystem_CAPS_staticIconSize

Gets the dimensions, in pixels, of the Windows default program icon size.

System_CAPS_pubpropertySystem_CAPS_staticIconSpacingSize

Gets the size, in pixels, of the grid square used to arrange icons in a large-icon view.

System_CAPS_pubpropertySystem_CAPS_staticIconVerticalSpacing

Gets the height, in pixels, of an icon arrangement cell in large icon view.

System_CAPS_pubpropertySystem_CAPS_staticIsActiveWindowTrackingEnabled

Gets a value indicating whether active window tracking is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsComboBoxAnimationEnabled

Gets a value indicating whether the slide-open effect for combo boxes is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsDropShadowEnabled

Gets a value indicating whether the drop shadow effect is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsFlatMenuEnabled

Gets a value indicating whether native user menus have a flat menu appearance.

System_CAPS_pubpropertySystem_CAPS_staticIsFontSmoothingEnabled

Gets a value indicating whether font smoothing is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsHotTrackingEnabled

Gets a value indicating whether hot tracking of user-interface elements, such as menu names on menu bars, is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsIconTitleWrappingEnabled

Gets a value indicating whether icon-title wrapping is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsKeyboardPreferred

Gets a value indicating whether the user relies on the keyboard instead of the mouse, and prefers applications to display keyboard interfaces that would otherwise be hidden.

System_CAPS_pubpropertySystem_CAPS_staticIsListBoxSmoothScrollingEnabled

Gets a value indicating whether the smooth-scrolling effect for list boxes is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsMenuAnimationEnabled

Gets a value indicating whether menu fade or slide animation features are enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsMenuFadeEnabled

Gets a value indicating whether menu fade animation is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsMinimizeRestoreAnimationEnabled

Gets a value indicating whether window minimize and restore animation is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsSelectionFadeEnabled

Gets a value indicating whether the selection fade effect is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsSnapToDefaultEnabled

Gets a value indicating whether the snap-to-default-button feature is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsTitleBarGradientEnabled

Gets a value indicating whether the gradient effect for window title bars is enabled.

System_CAPS_pubpropertySystem_CAPS_staticIsToolTipAnimationEnabled

Gets a value indicating whether ToolTip animation is enabled.

System_CAPS_pubpropertySystem_CAPS_staticKanjiWindowHeight

Gets the height, in pixels, of the Kanji window at the bottom of the screen for double-byte character set (DBCS) versions of Windows.

System_CAPS_pubpropertySystem_CAPS_staticKeyboardDelay

Gets the keyboard repeat-delay setting.

System_CAPS_pubpropertySystem_CAPS_staticKeyboardSpeed

Gets the keyboard repeat-speed setting.

System_CAPS_pubpropertySystem_CAPS_staticMaxWindowTrackSize

Gets the default maximum dimensions, in pixels, of a window that has a caption and sizing borders.

System_CAPS_pubpropertySystem_CAPS_staticMenuAccessKeysUnderlined

Gets a value indicating whether menu access keys are always underlined.

System_CAPS_pubpropertySystem_CAPS_staticMenuBarButtonSize

Gets the default width, in pixels, for menu-bar buttons and the height, in pixels, of a menu bar.

System_CAPS_pubpropertySystem_CAPS_staticMenuButtonSize

Gets the default dimensions, in pixels, of menu-bar buttons.

System_CAPS_pubpropertySystem_CAPS_staticMenuCheckSize

Gets the dimensions, in pixels, of the default size of a menu check mark area.

System_CAPS_pubpropertySystem_CAPS_staticMenuFont

Gets the font used to display text on menus.

System_CAPS_pubpropertySystem_CAPS_staticMenuHeight

Gets the height, in pixels, of one line of a menu.

System_CAPS_pubpropertySystem_CAPS_staticMenuShowDelay

Gets the time, in milliseconds, that the system waits before displaying a cascaded shortcut menu when the mouse cursor is over a submenu item.

System_CAPS_pubpropertySystem_CAPS_staticMidEastEnabled

Gets a value indicating whether the operating system is enabled for the Hebrew and Arabic languages.

System_CAPS_pubpropertySystem_CAPS_staticMinimizedWindowSize

Gets the dimensions, in pixels, of a normal minimized window.

System_CAPS_pubpropertySystem_CAPS_staticMinimizedWindowSpacingSize

Gets the dimensions, in pixels, of the area each minimized window is allocated when arranged.

System_CAPS_pubpropertySystem_CAPS_staticMinimumWindowSize

Gets the minimum width and height for a window, in pixels.

System_CAPS_pubpropertySystem_CAPS_staticMinWindowTrackSize

Gets the default minimum dimensions, in pixels, that a window may occupy during a drag resize.

System_CAPS_pubpropertySystem_CAPS_staticMonitorCount

Gets the number of display monitors on the desktop.

System_CAPS_pubpropertySystem_CAPS_staticMonitorsSameDisplayFormat

Gets a value indicating whether all the display monitors are using the same pixel color format.

System_CAPS_pubpropertySystem_CAPS_staticMouseButtons

Gets the number of buttons on the mouse.

System_CAPS_pubpropertySystem_CAPS_staticMouseButtonsSwapped

Gets a value indicating whether the functions of the left and right mouse buttons have been swapped.

System_CAPS_pubpropertySystem_CAPS_staticMouseHoverSize

Gets the dimensions, in pixels, of the rectangle within which the mouse pointer has to stay for the mouse hover time before a mouse hover message is generated.

System_CAPS_pubpropertySystem_CAPS_staticMouseHoverTime

Gets the time, in milliseconds, that the mouse pointer has to stay in the hover rectangle before a mouse hover message is generated.

System_CAPS_pubpropertySystem_CAPS_staticMousePresent

Gets a value indicating whether a pointing device is installed.

System_CAPS_pubpropertySystem_CAPS_staticMouseSpeed

Gets the current mouse speed.

System_CAPS_pubpropertySystem_CAPS_staticMouseWheelPresent

Gets a value indicating whether a mouse with a mouse wheel is installed.

System_CAPS_pubpropertySystem_CAPS_staticMouseWheelScrollDelta

Gets the amount of the delta value of a single mouse wheel rotation increment.

System_CAPS_pubpropertySystem_CAPS_staticMouseWheelScrollLines

Gets the number of lines to scroll when the mouse wheel is rotated.

System_CAPS_pubpropertySystem_CAPS_staticNativeMouseWheelSupport

Gets a value indicating whether the operating system natively supports a mouse wheel.

System_CAPS_pubpropertySystem_CAPS_staticNetwork

Gets a value indicating whether a network connection is present.

System_CAPS_pubpropertySystem_CAPS_staticPenWindows

Gets a value indicating whether the Microsoft Windows for Pen Computing extensions are installed.

System_CAPS_pubpropertySystem_CAPS_staticPopupMenuAlignment

Gets the side of pop-up menus that are aligned to the corresponding menu-bar item.

System_CAPS_pubpropertySystem_CAPS_staticPowerStatus

Gets the current system power status.

System_CAPS_pubpropertySystem_CAPS_staticPrimaryMonitorMaximizedWindowSize

Gets the default dimensions, in pixels, of a maximized window on the primary display.

System_CAPS_pubpropertySystem_CAPS_staticPrimaryMonitorSize

Gets the dimensions, in pixels, of the current video mode of the primary display.

System_CAPS_pubpropertySystem_CAPS_staticRightAlignedMenus

Gets a value indicating whether drop-down menus are right-aligned with the corresponding menu-bar item.

System_CAPS_pubpropertySystem_CAPS_staticScreenOrientation

Gets the orientation of the screen.

System_CAPS_pubpropertySystem_CAPS_staticSecure

Gets a value indicating whether a Security Manager is present on this operating system.

System_CAPS_pubpropertySystem_CAPS_staticShowSounds

Gets a value indicating whether the user prefers that an application present information in visual form in situations when it would present the information in audible form.

System_CAPS_pubpropertySystem_CAPS_staticSizingBorderWidth

Gets the width, in pixels, of the sizing border drawn around the perimeter of a window being resized.

System_CAPS_pubpropertySystem_CAPS_staticSmallCaptionButtonSize

Gets the width, in pixels, of small caption buttons, and the height, in pixels, of small captions.

System_CAPS_pubpropertySystem_CAPS_staticSmallIconSize

Gets the dimensions, in pixels, of a small icon.

System_CAPS_pubpropertySystem_CAPS_staticTerminalServerSession

Gets a value indicating whether the calling process is associated with a Terminal Services client session.

System_CAPS_pubpropertySystem_CAPS_staticToolWindowCaptionButtonSize

Gets the dimensions, in pixels, of small caption buttons.

System_CAPS_pubpropertySystem_CAPS_staticToolWindowCaptionHeight

Gets the height, in pixels, of a tool window caption.

System_CAPS_pubpropertySystem_CAPS_staticUIEffectsEnabled

Gets a value indicating whether user interface (UI) effects are enabled or disabled.

System_CAPS_pubpropertySystem_CAPS_staticUserDomainName

Gets the name of the domain the user belongs to.

System_CAPS_pubpropertySystem_CAPS_staticUserInteractive

Gets a value indicating whether the current process is running in user-interactive mode.

System_CAPS_pubpropertySystem_CAPS_staticUserName

Gets the user name associated with the current thread.

System_CAPS_pubpropertySystem_CAPS_staticVerticalFocusThickness

Gets the thickness, in pixels, of the top and bottom edges of the system focus rectangle.

System_CAPS_pubpropertySystem_CAPS_staticVerticalResizeBorderThickness

Gets the thickness, in pixels, of the top and bottom edges of the sizing border around the perimeter of a window being resized.

System_CAPS_pubpropertySystem_CAPS_staticVerticalScrollBarArrowHeight

Gets the height, in pixels, of the arrow bitmap on the vertical scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticVerticalScrollBarThumbHeight

Gets the height, in pixels, of the scroll box in a vertical scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticVerticalScrollBarWidth

Gets the default width, in pixels, of the vertical scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticVirtualScreen

Gets the bounds of the virtual screen.

System_CAPS_pubpropertySystem_CAPS_staticWorkingArea

Gets the size, in pixels, of the working area of the screen.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The SystemInformation class provides static properties that can be used to get information about the current system environment. The class provides access to information such as Windows display element sizes, operating system settings, network availability, and the capabilities of hardware installed on the system. This class cannot be instantiated.

For more information about system-wide parameters, see "SystemParametersInfo" in the Platform SDK documentation at http://msdn.microsoft.com.

The following code example lists all properties of the SystemInformation class in a ListBox and displays the current value of the property in a TextBox when a list item selected.

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;

namespace SystemInfoBrowser
{
    public class SystemInfoBrowserForm : System.Windows.Forms.Form
    {
        private System.Windows.Forms.ListBox listBox1;
        private System.Windows.Forms.TextBox textBox1;        

        public SystemInfoBrowserForm()
	    {
            this.SuspendLayout();
            InitForm();

            // Add each property of the SystemInformation class to the list box.
            Type t = typeof(System.Windows.Forms.SystemInformation);            
            PropertyInfo[] pi = t.GetProperties();            
            for( int i=0; i<pi.Length; i++ )
                listBox1.Items.Add( pi[i].Name );            
            textBox1.Text = "The SystemInformation class has "+pi.Length.ToString()+" properties.\r\n";

            // Configure the list item selected handler for the list box to invoke a 
            // method that displays the value of each property.
            listBox1.SelectedIndexChanged += new EventHandler(listBox1_SelectedIndexChanged);
            this.ResumeLayout(false);
	    }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Return if no list item is selected.
            if( listBox1.SelectedIndex == -1 ) return;
            // Get the property name from the list item.
            string propname = listBox1.Text;

            if( propname == "PowerStatus" )
            {
                // Cycle and display the values of each property of the PowerStatus property.
                textBox1.Text += "\r\nThe value of the PowerStatus property is:";                                
                Type t = typeof(System.Windows.Forms.PowerStatus);
                PropertyInfo[] pi = t.GetProperties();            
                for( int i=0; i<pi.Length; i++ )
                {
                    object propval = pi[i].GetValue(SystemInformation.PowerStatus, null);            
                    textBox1.Text += "\r\n    PowerStatus."+pi[i].Name+" is: "+propval.ToString();
                }
            }
            else
            {
                // Display the value of the selected property of the SystemInformation type.
                Type t = typeof(System.Windows.Forms.SystemInformation);
                PropertyInfo[] pi = t.GetProperties();            
                PropertyInfo prop = null;
                for( int i=0; i<pi.Length; i++ )
                    if( pi[i].Name == propname )
                    {
                        prop = pi[i];
                        break;           
                    }
                object propval = prop.GetValue(null, null);            
                textBox1.Text += "\r\nThe value of the "+propname+" property is: "+propval.ToString();
            }
        }

        private void InitForm()
        {
            // Initialize the form settings
            this.listBox1 = new System.Windows.Forms.ListBox();
            this.textBox1 = new System.Windows.Forms.TextBox();            
            this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
            this.listBox1.Location = new System.Drawing.Point(8, 16);
            this.listBox1.Size = new System.Drawing.Size(172, 496);
            this.listBox1.TabIndex = 0;            
            this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                | System.Windows.Forms.AnchorStyles.Right)));
            this.textBox1.Location = new System.Drawing.Point(188, 16);
            this.textBox1.Multiline = true;
            this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;           
            this.textBox1.Size = new System.Drawing.Size(420, 496);
            this.textBox1.TabIndex = 1;            
            this.ClientSize = new System.Drawing.Size(616, 525);            
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.listBox1);            
            this.Text = "Select a SystemInformation property to get the value of";                   
        }

        [STAThread]
        static void Main() 
        {
            Application.Run(new SystemInfoBrowserForm());
        }
    }
}

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft