+ internal override int ActiveWindowTrackingDelay {
+ get { return GetSystemParametersInfoInt (SPIAction.SPI_GETACTIVEWNDTRKTIMEOUT); }
+ }
+
+ internal override int CaretWidth {
+ get {
+ // Supported on 2k, XP, 2k3 +
+ if (Environment.OSVersion.Version.Major < 5)
+ throw new NotSupportedException ();
+
+ return GetSystemParametersInfoInt (SPIAction.SPI_GETCARETWIDTH);
+ }
+ }
+
+ internal override int FontSmoothingContrast {
+ get {
+ // Supported on XP, 2k3 +
+ if (Environment.OSVersion.Version.Major < 5 || (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 0))
+ throw new NotSupportedException ();
+
+ return GetSystemParametersInfoInt (SPIAction.SPI_GETFONTSMOOTHINGCONTRAST);
+ }
+ }
+
+ internal override int FontSmoothingType {
+ get {
+ // Supported on XP, 2k3 +
+ if (Environment.OSVersion.Version.Major < 5 || (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 0))
+ throw new NotSupportedException ();
+
+ return GetSystemParametersInfoInt (SPIAction.SPI_GETFONTSMOOTHINGTYPE);
+ }
+ }
+
+ internal override int HorizontalResizeBorderThickness {
+ get { return Win32GetSystemMetrics (SystemMetrics.SM_CXSIZEFRAME); }
+ }
+
+ internal override bool IsActiveWindowTrackingEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETACTIVEWINDOWTRACKING); }
+ }
+
+ internal override bool IsComboBoxAnimationEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETCOMBOBOXANIMATION); }
+ }
+
+ internal override bool IsDropShadowEnabled {
+ get {
+ // Supported on XP, 2k3 +
+ if (Environment.OSVersion.Version.Major < 5 || (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 0))
+ throw new NotSupportedException ();
+
+ return GetSystemParametersInfoBool (SPIAction.SPI_GETDROPSHADOW);
+ }
+ }
+
+ internal override bool IsFontSmoothingEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETFONTSMOOTHING); }
+ }
+
+ internal override bool IsHotTrackingEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETHOTTRACKING); }
+ }
+
+ internal override bool IsIconTitleWrappingEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETICONTITLEWRAP); }
+ }
+
+ internal override bool IsKeyboardPreferred {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETKEYBOARDPREF); }
+ }
+
+ internal override bool IsListBoxSmoothScrollingEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETLISTBOXSMOOTHSCROLLING); }
+ }
+
+ internal override bool IsMenuAnimationEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETMENUANIMATION); }
+ }
+
+ internal override bool IsMenuFadeEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETMENUFADE); }
+ }
+
+ internal override bool IsMinimizeRestoreAnimationEnabled {
+ get {
+ ANIMATIONINFO ai = new ANIMATIONINFO ();
+ ai.cbSize = (uint)Marshal.SizeOf (ai);
+
+ Win32SystemParametersInfo (SPIAction.SPI_GETANIMATION, 0, ref ai, 0);
+ return ai.iMinAnimate == 0 ? false : true;
+ }
+ }
+
+ internal override bool IsSelectionFadeEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETSELECTIONFADE); }
+ }
+
+ internal override bool IsSnapToDefaultEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETSNAPTODEFBUTTON); }
+ }
+
+ internal override bool IsTitleBarGradientEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETGRADIENTCAPTIONS); }
+ }
+
+ internal override bool IsToolTipAnimationEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETTOOLTIPANIMATION); }
+ }
+
+ internal override Size MenuBarButtonSize {
+ get {
+ return new Size (Win32GetSystemMetrics (SystemMetrics.SM_CXMENUSIZE),
+ Win32GetSystemMetrics (SystemMetrics.SM_CYMENUSIZE));
+ }
+ }
+
+ public override Size MenuButtonSize {
+ get {
+ return new Size (
+ Win32GetSystemMetrics (SystemMetrics.SM_CXMENUSIZE),
+ Win32GetSystemMetrics (SystemMetrics.SM_CYMENUSIZE));
+ }
+ }
+
+ internal override int MenuShowDelay {
+ get { return GetSystemParametersInfoInt (SPIAction.SPI_GETMENUSHOWDELAY); }
+ }
+
+ internal override int MouseSpeed {
+ get { return GetSystemParametersInfoInt (SPIAction.SPI_GETMOUSESPEED); }
+ }
+
+ internal override LeftRightAlignment PopupMenuAlignment {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETMENUDROPALIGNMENT) == true ? LeftRightAlignment.Left : LeftRightAlignment.Right; }
+ }
+
+ internal override PowerStatus PowerStatus {
+ get {
+ SYSTEMPOWERSTATUS p = new SYSTEMPOWERSTATUS ();
+
+ Win32GetSystemPowerStatus (p);
+
+ PowerStatus ps = new PowerStatus ((BatteryChargeStatus)p._BatteryFlag, p._BatteryFullLifeTime, (float)p._BatteryLifePercent / 255f, p._BatteryLifeTime, (PowerLineStatus)p._ACLineStatus);
+
+ return ps;
+ }
+ }
+
+ internal override int SizingBorderWidth {
+ get { return Win32GetSystemMetrics (SystemMetrics.SM_CXSIZEFRAME); }
+ }
+
+ internal override Size SmallCaptionButtonSize {
+ get {
+ return new Size (Win32GetSystemMetrics (SystemMetrics.SM_CXSMSIZE),
+ Win32GetSystemMetrics (SystemMetrics.SM_CYSMSIZE));
+ }
+ }
+
+ internal override bool UIEffectsEnabled {
+ get { return GetSystemParametersInfoBool (SPIAction.SPI_GETUIEFFECTS); }
+ }
+
+ internal override int VerticalResizeBorderThickness {
+ get { return Win32GetSystemMetrics (SystemMetrics.SM_CYSIZEFRAME); }
+ }
+
+ internal override void RaiseIdle (EventArgs e)
+ {
+ if (Idle != null)
+ Idle (this, e);
+ }
+