Advertisement
Guest User

EnvironmentUtil.vb By Elektro (28/June/2015))

a guest
Jun 27th, 2015
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 446.56 KB | None | 0 0
  1. ' ***********************************************************************
  2. ' Author   : Elektro
  3. ' Modified : 23-June-2015
  4. ' ***********************************************************************
  5. ' <copyright file="EnvironmentUtil.vb" company="Elektro Studios">
  6. '     Copyright (c) Elektro Studios. All rights reserved.
  7. ' </copyright>
  8. ' ***********************************************************************
  9.  
  10. #Region " ToDo: "
  11.  
  12. ' Implement more API wrappers to supply more member clones of the rest of "System.Windows.Forms.SystemInformation" properties, with setters.
  13.  
  14. #End Region
  15.  
  16. #Region " Public Members Summary "
  17.  
  18. #Region " Child Util-Classes "
  19.  
  20. ' EnvironmentUtil.EnvironmentVariables
  21. ' EnvironmentUtil.FileSystem
  22. ' EnvironmentUtil.OS
  23. ' EnvironmentUtil.Programs
  24. ' EnvironmentUtil.Shell
  25. ' EnvironmentUtil.Shell.Desktop
  26. ' EnvironmentUtil.Shell.Explorer
  27. ' EnvironmentUtil.Shell.StartMenu
  28. ' EnvironmentUtil.Shell.TaskBar
  29. ' EnvironmentUtil.Theming
  30.  
  31. #End Region
  32.  
  33. #Region " Properties "
  34.  
  35. ' EnvironmentUtil.EnvironmentVariables.CurrentVariables(EnvironmentUtil.EnvironmentUser) As ReadOnlyCollection(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)
  36. ' EnvironmentUtil.OS.ActiveWindowTrackingEnabled As Boolean
  37. ' EnvironmentUtil.OS.ActiveWindowTrackingTimeout As UShort
  38. ' EnvironmentUtil.OS.BeepEnabled As Boolean
  39. ' EnvironmentUtil.OS.BlockSendInputResetsEnabled As Boolean
  40. ' EnvironmentUtil.OS.BorderMultiplierFactor As Integer
  41. ' EnvironmentUtil.OS.CaretWidth As Integer
  42. ' EnvironmentUtil.OS.CleartypeEnabled As Boolean
  43. ' EnvironmentUtil.OS.ClientAreaAnimationEnabled As Boolean
  44. ' EnvironmentUtil.OS.ComboBoxAnimationEnabled As Boolean
  45. ' EnvironmentUtil.OS.CurrentArchitecture() As EnvironmentUtil.OS.Architecture
  46. ' EnvironmentUtil.OS.CursorShadowEnabled As Boolean
  47. ' EnvironmentUtil.OS.DoubleClickSize As Size
  48. ' EnvironmentUtil.OS.DoubleClickTime As Integer
  49. ' EnvironmentUtil.OS.DragFullWindowsEnabled As Boolean
  50. ' EnvironmentUtil.OS.DragSize As Size
  51. ' EnvironmentUtil.OS.DropShadowEnabled As Boolean
  52. ' EnvironmentUtil.OS.FlatMenuEnabled As Boolean
  53. ' EnvironmentUtil.OS.FocusBorderSize As Size
  54. ' EnvironmentUtil.OS.FontSmoothingContrast As Integer
  55. ' EnvironmentUtil.OS.FontSmoothingEnabled As Boolean
  56. ' EnvironmentUtil.OS.ForegroundFlashCount As UShort
  57. ' EnvironmentUtil.OS.ForegroundLockTimeout As UShort
  58. ' EnvironmentUtil.OS.HotTrackingEnabled As Boolean
  59. ' EnvironmentUtil.OS.HungAppTimeout As Integer
  60. ' EnvironmentUtil.OS.IconSpacing As Size
  61. ' EnvironmentUtil.OS.IconTitleWrappingEnabled As Boolean
  62. ' EnvironmentUtil.OS.KeyboardDelay As Integer
  63. ' EnvironmentUtil.OS.KeyboardSpeed As Integer
  64. ' EnvironmentUtil.OS.ListBoxSmoothScrollingEnabled As Boolean
  65. ' EnvironmentUtil.OS.MenuAccessKeysUnderlined As Boolean
  66. ' EnvironmentUtil.OS.MenuAnimationEnabled As Boolean
  67. ' EnvironmentUtil.OS.MenuFadeEnabled As Boolean
  68. ' EnvironmentUtil.OS.MenuShowDelay As Integer
  69. ' EnvironmentUtil.OS.MessageDuration As Long
  70. ' EnvironmentUtil.OS.MouseButtonsSwapEnabled As Boolean
  71. ' EnvironmentUtil.OS.MouseClickLockEnabled As Boolean
  72. ' EnvironmentUtil.OS.MouseClickLockTime As Integer
  73. ' EnvironmentUtil.OS.MouseHoverSize As Size
  74. ' EnvironmentUtil.OS.MouseHoverTime As Integer
  75. ' EnvironmentUtil.OS.MouseSonarEnabled As Boolean
  76. ' EnvironmentUtil.OS.MouseSpeed As Integer
  77. ' EnvironmentUtil.OS.MouseTrailAmount As Integer
  78. ' EnvironmentUtil.OS.MouseVanishEnabled As Boolean
  79. ' EnvironmentUtil.OS.MouseWheelScrollLines As Integer
  80. ' EnvironmentUtil.OS.OverlappedContentEnabled As Boolean
  81. ' EnvironmentUtil.OS.PopupMenuAlignment As LeftRightAlignment
  82. ' EnvironmentUtil.OS.ScreensaverEnabled As Boolean
  83. ' EnvironmentUtil.OS.ScreensaverPath As String
  84. ' EnvironmentUtil.OS.ScreensaverTimeout As Integer
  85. ' EnvironmentUtil.OS.ScreensaveSecureEnabled As Boolean
  86. ' EnvironmentUtil.OS.SelectionFadeEnabled As Boolean
  87. ' EnvironmentUtil.OS.SnapToDefaultEnabled As Boolean
  88. ' EnvironmentUtil.OS.SystemDateTime As Date
  89. ' EnvironmentUtil.OS.SystemLanguageBarEnabled As Boolean
  90. ' EnvironmentUtil.OS.TitleBarGradientEnabled As Boolean
  91. ' EnvironmentUtil.OS.ToolTipAnimationEnabled As Boolean
  92. ' EnvironmentUtil.OS.UIEffectsEnabled As Boolean
  93. ' EnvironmentUtil.OS.WaitToKillAppTimeout As Integer
  94. ' EnvironmentUtil.OS.WaitToKillServiceTimeout As Integer
  95. ' EnvironmentUtil.OS.WheelscrollChars As Integer
  96. ' EnvironmentUtil.Programs.DefaultWebBrowser() As String
  97. ' EnvironmentUtil.Programs.IExplorerVersion() As Version
  98. ' EnvironmentUtil.Shell.Explorer.ExplorerWindows As ReadOnlyCollection(Of ShellBrowserWindow)
  99. ' EnvironmentUtil.Shell.Explorer.ExplorerWindowsFolders As ReadOnlyCollection(Of Shell32.Folder2)
  100. ' EnvironmentUtil.Shell.TaskBar.ClassName() As String
  101. ' EnvironmentUtil.Shell.TaskBar.Hwnd() As Intptr
  102. ' EnvironmentUtil.Theming.AeroEnabled() As Boolean
  103. ' EnvironmentUtil.Theming.AeroSupported() As Boolean
  104. ' EnvironmentUtil.Theming.CurrentTheme() As EnvironmentUtil.Theming.ThemeInfo
  105. ' EnvironmentUtil.Theming.CurrentWallpaper() As String
  106. ' EnvironmentUtil.Theming.WallpaperAsJpegIsSupported() As Boolean
  107. ' EnvironmentUtil.Theming.WallpaperStylesFitFillAreSupported() As Boolean
  108.  
  109. #End Region
  110.  
  111. #Region " Types "
  112.  
  113. ' EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo
  114. ' EnvironmentUtil.Theming.ThemeInfo
  115.  
  116. #End Region
  117.  
  118. #Region " Functions "
  119.  
  120. ' EnvironmentUtil.EnvironmentVariables.GetValue(EnvironmentUtil.EnvironmentUser, String, Boolean) As String
  121. ' EnvironmentUtil.EnvironmentVariables.GetVariableInfo(EnvironmentUtil.EnvironmentUser, String, Boolean) As EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo
  122. ' EnvironmentUtil.FileSystem.GetItemVerbs(String) As IEnumerable(Of FolderItemVerb)
  123. ' EnvironmentUtil.FileSystem.ItemNameIsInvalid(String) As Boolean
  124. ' EnvironmentUtil.FileSystem.ItemNameOrPathIsInvalid(String) As Boolean
  125. ' EnvironmentUtil.FileSystem.ItemPathIsInvalid(String) As Boolean
  126.  
  127. #End Region
  128.  
  129. #Region " Methods "
  130.  
  131. ' EnvironmentUtil.EnvironmentVariables.RegisterVariable(EnvironmentUtil.EnvironmentUser, EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo, Boolean)
  132. ' EnvironmentUtil.EnvironmentVariables.RegisterVariable(EnvironmentUtil.EnvironmentUser, String, String, Boolean)
  133. ' EnvironmentUtil.EnvironmentVariables.UnregisterVariable(EnvironmentUtil.EnvironmentUser, String, Boolean)
  134. ' EnvironmentUtil.FileSystem.InvokeItemVerb(String, String)
  135. ' EnvironmentUtil.OS.NotifyDirectoryAttributesChanged(String)
  136. ' EnvironmentUtil.OS.NotifyDirectoryCreated(String)
  137. ' EnvironmentUtil.OS.NotifyDirectoryDeleted(String)
  138. ' EnvironmentUtil.OS.NotifyDirectoryRenamed(String, String)
  139. ' EnvironmentUtil.OS.NotifyDriveAdded(String, Boolean)
  140. ' EnvironmentUtil.OS.NotifyDriveRemoved(String)
  141. ' EnvironmentUtil.OS.NotifyFileAssociationChanged()
  142. ' EnvironmentUtil.OS.NotifyFileAttributesChanged(String)
  143. ' EnvironmentUtil.OS.NotifyFileCreated(String)
  144. ' EnvironmentUtil.OS.NotifyFileDeleted(String)
  145. ' EnvironmentUtil.OS.NotifyFileRenamed(String, String)
  146. ' EnvironmentUtil.OS.NotifyFreespaceChanged(String)
  147. ' EnvironmentUtil.OS.NotifyMediaInserted(String)
  148. ' EnvironmentUtil.OS.NotifyMediaRemoved(String)
  149. ' EnvironmentUtil.OS.NotifyNetworkFolderShared(String)
  150. ' EnvironmentUtil.OS.NotifyNetworkFolderUnshared(String)
  151. ' EnvironmentUtil.OS.NotifyUpdateDirectory(String)
  152. ' EnvironmentUtil.OS.NotifyUpdateImage()
  153. ' EnvironmentUtil.OS.ReloadSystemCursors()
  154. ' EnvironmentUtil.OS.ReloadSystemIcons()
  155. ' EnvironmentUtil.OS.RunDateTime()
  156. ' EnvironmentUtil.OS.RunExecuteDialog()
  157. ' EnvironmentUtil.OS.RunFindComputer()
  158. ' EnvironmentUtil.OS.RunFindFiles()
  159. ' EnvironmentUtil.OS.RunFindPrinter()
  160. ' EnvironmentUtil.OS.RunHelpCenter()
  161. ' EnvironmentUtil.OS.RunSearchCommand()
  162. ' EnvironmentUtil.OS.RunTrayProperties()
  163. ' EnvironmentUtil.OS.RunWindowsSecurity()
  164. ' EnvironmentUtil.OS.RunWindowSwitcher()
  165. ' EnvironmentUtil.Shell.Desktop.CascadeWindows()
  166. ' EnvironmentUtil.Shell.Desktop.Hide()
  167. ' EnvironmentUtil.Shell.Desktop.Show()
  168. ' EnvironmentUtil.Shell.Desktop.TileWindowsHorizontally()
  169. ' EnvironmentUtil.Shell.Desktop.TileWindowsVertically()
  170. ' EnvironmentUtil.Shell.Desktop.ToggleState()
  171. ' EnvironmentUtil.Shell.Explorer.AddFileToRecentDocs(String)
  172. ' EnvironmentUtil.Shell.Explorer.RefreshWindows()
  173. ' EnvironmentUtil.Shell.StartMenu.PinItem(String)
  174. ' EnvironmentUtil.Shell.StartMenu.UnpinItem(String)
  175. ' EnvironmentUtil.Shell.TaskBar.Hide(Boolean)
  176. ' EnvironmentUtil.Shell.TaskBar.PinItem(String)
  177. ' EnvironmentUtil.Shell.TaskBar.Show(Boolean)
  178. ' EnvironmentUtil.Shell.TaskBar.UnpinItem(String)
  179. ' EnvironmentUtil.Theming.RemoveDesktopWallpaper()
  180. ' EnvironmentUtil.Theming.SetDesktopWallpaper(String, EnvironmentUtil.Theming.WallpaperStyle)
  181. ' EnvironmentUtil.Theming.SetSystemCursor(String, EnvironmentUtil.Theming.CursorType)
  182.  
  183. #End Region
  184.  
  185. #End Region
  186.  
  187. #Region " Option Statements "
  188.  
  189. Option Strict On
  190. Option Explicit On
  191. Option Infer Off
  192.  
  193. #End Region
  194.  
  195. #Region " Imports "
  196.  
  197. Imports Microsoft.Win32
  198. Imports System
  199. Imports System.Collections.ObjectModel
  200. Imports System.ComponentModel
  201. Imports System.IO
  202. Imports System.Linq
  203. Imports System.Runtime.InteropServices
  204. Imports System.Security.Permissions
  205. Imports System.Text
  206. Imports System.Windows.Forms
  207. Imports Shell32
  208. Imports SHDocVw
  209.  
  210. #End Region
  211.  
  212. #Region " Environment Util "
  213.  
  214. ''' ----------------------------------------------------------------------------------------------------
  215. ''' <summary>
  216. ''' Contains related Windows environment utilities.
  217. ''' </summary>
  218. ''' ----------------------------------------------------------------------------------------------------
  219. Public NotInheritable Class EnvironmentUtil
  220.  
  221. #Region " P/Invoking "
  222.  
  223.     ''' ----------------------------------------------------------------------------------------------------
  224.     ''' <summary>
  225.     ''' Platform Invocation methods (P/Invoke), access unmanaged code.
  226.     ''' This class does not suppress stack walks for unmanaged code permission.
  227.     ''' <see cref="System.Security.SuppressUnmanagedCodeSecurityAttribute"/> must not be applied to this class.
  228.     ''' This class is for methods that can be used anywhere because a stack walk will be performed.
  229.     ''' </summary>
  230.     ''' ----------------------------------------------------------------------------------------------------
  231.     ''' <remarks>http://msdn.microsoft.com/en-us/library/ms182161.aspx</remarks>
  232.     ''' ----------------------------------------------------------------------------------------------------
  233.     Private NotInheritable Class NativeMethods
  234.  
  235. #Region " Functions "
  236.  
  237.         ''' ----------------------------------------------------------------------------------------------------
  238.         ''' <summary>
  239.         ''' Sends the specified message to a window or windows.
  240.         ''' The SendMessage function calls the window procedure for the specified window
  241.         ''' and does not return until the window procedure has processed the message.
  242.         ''' </summary>
  243.         ''' ----------------------------------------------------------------------------------------------------
  244.         ''' <param name="hWnd">
  245.         ''' A handle to the window whose window procedure will receive the message.
  246.         ''' </param>
  247.         '''
  248.         ''' <param name="msg">
  249.         ''' The message to be sent.
  250.         ''' </param>
  251.         '''
  252.         ''' <param name="wParam">
  253.         ''' Additional message-specific information.
  254.         ''' </param>
  255.         '''
  256.         ''' <param name="lParam">
  257.         ''' Additional message-specific information.
  258.         ''' </param>
  259.         ''' ----------------------------------------------------------------------------------------------------
  260.         ''' <returns>
  261.         ''' The return value specifies the result of the message processing; it depends on the message sent.
  262.         ''' </returns>
  263.         ''' ----------------------------------------------------------------------------------------------------
  264.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx</remarks>
  265.         ''' ----------------------------------------------------------------------------------------------------
  266.         <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  267.         Friend Shared Function SendMessage(
  268.                                ByVal hWnd As IntPtr,
  269.                                ByVal msg As WindowsMessages,
  270.                                ByVal wParam As IntPtr,
  271.                                ByVal lParam As IntPtr
  272.         ) As IntPtr
  273.         End Function
  274.  
  275.         ''' ----------------------------------------------------------------------------------------------------
  276.         ''' <summary>
  277.         ''' Enables an application to customize the system cursors.
  278.         ''' It replaces the contents of the system cursor specified by the <paramfer name="id"/> parameter
  279.         ''' with the contents of the cursor specified by the <paramfer name="hCursor"/> parameter and then destroys <paramfer name="hCursor"/>.
  280.         ''' </summary>
  281.         ''' ----------------------------------------------------------------------------------------------------
  282.         ''' <param name="hCursor">
  283.         ''' A handle to the cursor.
  284.         ''' The function replaces the contents of the system cursor specified by <paramfer name="id"/> parameter  
  285.         ''' with the contents of the cursor handled by <paramfer name="hCursor"/> parameter.
  286.         ''' </param>
  287.         '''
  288.         ''' <param name="id">
  289.         ''' The system cursor to replace with the contents of <paramfer name="hCursor"/> parameter.
  290.         ''' </param>
  291.         ''' ----------------------------------------------------------------------------------------------------
  292.         ''' <returns>
  293.         ''' If the function succeeds, the return value is <c>True</c>.
  294.         ''' If the function fails, the return value is <c>False</c>.
  295.         ''' </returns>
  296.         ''' ----------------------------------------------------------------------------------------------------
  297.         ''' <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms648395%28v=vs.85%29.aspx</remarks>
  298.         ''' ----------------------------------------------------------------------------------------------------
  299.         <DllImport("user32.dll", SetLastError:=True)>
  300.         Friend Shared Function SetSystemCursor(
  301.                                ByVal hCursor As IntPtr,
  302.                                ByVal id As Short
  303.         ) As Boolean
  304.         End Function
  305.  
  306.         ''' ----------------------------------------------------------------------------------------------------
  307.         ''' <summary>
  308.         ''' Creates a cursor based on data contained in a file.
  309.         ''' </summary>
  310.         ''' ----------------------------------------------------------------------------------------------------
  311.         ''' <param name="lpFileName">
  312.         ''' The source of the file data to be used to create the cursor.
  313.         ''' The data in the file must be in either .CUR or .ANI format.
  314.         ''' </param>
  315.         ''' ----------------------------------------------------------------------------------------------------
  316.         ''' <returns>
  317.         ''' If the function succeeds, the return value is an <see cref="IntPtr"/> handle to the new cursor.
  318.         ''' If the function fails, the return value is <see cref="IntPtr.Zero"/>.
  319.         ''' </returns>
  320.         ''' ----------------------------------------------------------------------------------------------------
  321.         ''' <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms648392%28v=vs.85%29.aspx</remarks>
  322.         ''' ----------------------------------------------------------------------------------------------------
  323.         <DllImport("user32.dll", SetLastError:=True)>
  324.         Friend Shared Function LoadCursorFromFile(
  325.                                ByVal lpFileName As String
  326.         ) As IntPtr
  327.         End Function
  328.  
  329.         ''' ----------------------------------------------------------------------------------------------------
  330.         ''' <summary>
  331.         ''' Sends the specified message to one or more windows.
  332.         ''' </summary>
  333.         ''' ----------------------------------------------------------------------------------------------------
  334.         ''' <param name="hWnd">
  335.         ''' A handle to the window whose window procedure will receive the message.
  336.         '''
  337.         ''' If this parameter is <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.HWND_BROADCAST"/>,
  338.         ''' the message is sent to all top-level windows in the system, including disabled or invisible unowned windows.
  339.         '''
  340.         ''' The function does not return until each window has timed out.
  341.         ''' Therefore, the total wait time can be up to the value of uTimeout multiplied by the number of top-level windows.
  342.         ''' </param>
  343.         '''
  344.         ''' <param name="Msg">
  345.         ''' The message to be sent.
  346.         ''' For lists of the system-provided messages, see System-Defined Messages:
  347.         ''' https://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx#system_defined
  348.         ''' </param>
  349.         '''
  350.         ''' <param name="wParam">
  351.         ''' Any additional message-specific information.
  352.         ''' </param>
  353.         '''
  354.         ''' <param name="lParam">
  355.         ''' Any additional message-specific information.
  356.         ''' </param>
  357.         '''
  358.         ''' <param name="fuFlags">
  359.         ''' The behavior of this function.
  360.         ''' </param>
  361.         '''
  362.         ''' <param name="uTimeout">
  363.         ''' The duration of the time-out period, in milliseconds.
  364.         ''' If the message is a broadcast message, each window can use the full time-out period.
  365.         ''' For example, if you specify a five second time-out period and there are three top-level windows that fail to process the message,
  366.         ''' you could have up to a 15 second delay.
  367.         ''' </param>
  368.         '''
  369.         ''' <param name="lpdwResult">
  370.         ''' The result of the message processing.
  371.         ''' The value of this parameter depends on the message that is specified.
  372.         ''' </param>
  373.         ''' ----------------------------------------------------------------------------------------------------
  374.         ''' <returns>
  375.         ''' If the function succeeds, the return value is nonzero.
  376.         '''
  377.         ''' If the function fails or times out, the return value is 0.
  378.         '''
  379.         ''' <see cref="EnvironmentUtil.NativeMethods.SendMessageTimeout"/> does not provide information about
  380.         ''' individual windows timing out if <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.HWND_BROADCAST"/> is used.
  381.         '''
  382.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  383.         ''' If <see cref="Marshal.GetLastWin32Error"/> returns ERROR_TIMEOUT, then the function timed out.
  384.         ''' </returns>
  385.         ''' ----------------------------------------------------------------------------------------------------
  386.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms644952%28v=vs.85%29.aspx</remarks>
  387.         ''' ----------------------------------------------------------------------------------------------------
  388.         <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  389.         Friend Shared Function SendMessageTimeout(
  390.                                ByVal hwnd As IntPtr,
  391.                                ByVal msg As Integer,
  392.                                ByVal wParam As IntPtr,
  393.                                ByVal lParam As String,
  394.                                ByVal fuFlags As SendMessageTimeoutFlags,
  395.                                ByVal uTimeout As Integer,
  396.                          <Out> ByRef lpdwResult As IntPtr
  397.         ) As IntPtr
  398.         End Function
  399.  
  400.         ''' ----------------------------------------------------------------------------------------------------
  401.         ''' <summary>
  402.         ''' Retrieves the name of the current visual style, and optionally retrieves the color scheme name and size name.
  403.         ''' </summary>
  404.         ''' ----------------------------------------------------------------------------------------------------
  405.         ''' <param name="pszThemeFileName">
  406.         ''' Pointer to a string that receives the theme path and file name.
  407.         ''' </param>
  408.         '''
  409.         ''' <param name="dwMaxNameChars">
  410.         ''' The maximum number of characters allowed in the theme file name.
  411.         ''' </param>
  412.         '''
  413.         ''' <param name="pszColorBuff">
  414.         ''' Pointer to a string that receives the color scheme name. This parameter may be set to <c>Nothing</c>.
  415.         ''' </param>
  416.         '''
  417.         ''' <param name="cchMaxColorChars">
  418.         ''' The maximum number of characters allowed in the color scheme name.
  419.         ''' </param>
  420.         '''
  421.         ''' <param name="pszSizeBuff">
  422.         ''' Pointer to a string that receives the size name. This parameter may be set to NULL.</param>
  423.         '''
  424.         ''' <param name="cchMaxSizeChars">
  425.         ''' The maximum number of characters allowed in the size name.
  426.         ''' </param>
  427.         ''' ----------------------------------------------------------------------------------------------------
  428.         ''' <returns>Returns '0' if successful, otherwise, an error code.</returns>
  429.         ''' ----------------------------------------------------------------------------------------------------
  430.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb773365%28v=vs.85%29.aspx</remarks>
  431.         ''' ----------------------------------------------------------------------------------------------------
  432.         <DllImport("uxtheme", CharSet:=CharSet.Auto, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  433.         Friend Shared Function GetCurrentThemeName(
  434.                                ByVal pszThemeFileName As StringBuilder,
  435.                                ByVal dwMaxNameChars As Integer,
  436.                                ByVal pszColorBuff As StringBuilder,
  437.                                ByVal cchMaxColorChars As Integer,
  438.                                ByVal pszSizeBuff As StringBuilder,
  439.                                ByVal cchMaxSizeChars As Integer
  440.         ) As Integer
  441.         End Function
  442.  
  443.         ''' ----------------------------------------------------------------------------------------------------
  444.         ''' <summary>
  445.         ''' Retrieves a handle to the top-level window whose class name and window name match the specified strings.
  446.         ''' This function does not search child windows.
  447.         ''' This function does not perform a case-sensitive search.
  448.         ''' To search child windows, beginning with a specified child window, use the 'FindWindowEx' function.
  449.         ''' </summary>
  450.         ''' ----------------------------------------------------------------------------------------------------
  451.         ''' <param name="lpClassName">
  452.         ''' The class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function.
  453.         ''' The atom must be in the low-order word of <paramref name="lpClassName"></paramref>; the high-order word must be zero.
  454.         ''' If <paramref name="lpClassName"></paramref> is NULL, it finds any window whose title matches the <paramref name="lpWindowName"></paramref> parameter.
  455.         ''' </param>
  456.         '''
  457.         ''' <param name="lpWindowName">
  458.         ''' The window name (the window's titlebar title).
  459.         ''' If this parameter is <c>Nothing</c>, all window names match.
  460.         ''' </param>
  461.         ''' ----------------------------------------------------------------------------------------------------
  462.         ''' <returns>
  463.         ''' If the function succeeds, the return value is a handle to the window that has the specified class name and window name.
  464.         ''' If the function fails, the return value is <c>Nothing</c>.
  465.         ''' </returns>
  466.         ''' ----------------------------------------------------------------------------------------------------
  467.         ''' <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499%28v=vs.85%29.aspx</remarks>
  468.         ''' ----------------------------------------------------------------------------------------------------
  469.         <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  470.         Friend Shared Function FindWindow(
  471.                                ByVal lpClassName As String,
  472.                                ByVal lpWindowName As String
  473.         ) As IntPtr
  474.         End Function
  475.  
  476.         ''' ----------------------------------------------------------------------------------------------------
  477.         ''' <summary>
  478.         ''' Sets the specified window's show state.
  479.         ''' </summary>
  480.         ''' ----------------------------------------------------------------------------------------------------
  481.         ''' <param name="hwnd">
  482.         ''' A handle to the window.
  483.         ''' </param>
  484.         '''
  485.         ''' <param name="nCmdShow">
  486.         ''' Controls how the window is to be shown.
  487.         ''' </param>
  488.         ''' ----------------------------------------------------------------------------------------------------
  489.         ''' <returns>
  490.         ''' If the window was previously visible, the return value is nonzero.
  491.         ''' If the window was previously hidden, the return value is zero.
  492.         ''' </returns>
  493.         ''' ----------------------------------------------------------------------------------------------------
  494.         ''' <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms633548%28v=vs.85%29.aspx</remarks>
  495.         ''' ----------------------------------------------------------------------------------------------------
  496.         <DllImport("user32.dll")>
  497.         Friend Shared Function ShowWindow(
  498.                                ByVal hwnd As IntPtr,
  499.                                ByVal nCmdShow As Integer
  500.         ) As Integer
  501.         End Function
  502.  
  503.         ''' ----------------------------------------------------------------------------------------------------
  504.         ''' <summary>
  505.         ''' Obtains a value that indicates whether Desktop Window Manager (DWM) composition is enabled.
  506.         ''' Applications on machines running Windows 7 or earlier can listen for composition state changes by handling the WM_DWMCOMPOSITIONCHANGED notification.
  507.         ''' </summary>
  508.         ''' ----------------------------------------------------------------------------------------------------
  509.         ''' <param name="enabled">
  510.         ''' A pointer to a value that, when this function returns successfully, receives <c>True</c> if DWM composition is enabled; otherwise, <c>False</c>.
  511.         ''' </param>
  512.         ''' ----------------------------------------------------------------------------------------------------
  513.         ''' <returns>
  514.         ''' this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
  515.         ''' </returns>
  516.         ''' ----------------------------------------------------------------------------------------------------
  517.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/aa969518%28v=vs.85%29.aspx</remarks>
  518.         ''' ----------------------------------------------------------------------------------------------------
  519.         <DllImport("dwmapi.dll")>
  520.         Friend Shared Function DwmIsCompositionEnabled(
  521.                                ByRef enabled As Boolean
  522.         ) As Integer
  523.         End Function
  524.  
  525.         ''' ----------------------------------------------------------------------------------------------------
  526.         ''' <summary>
  527.         ''' Retrieves or sets the value of one of the system-wide parameters.
  528.         ''' This function can also update the user profile while setting a parameter.
  529.         ''' </summary>
  530.         ''' ----------------------------------------------------------------------------------------------------
  531.         ''' <param name="uiAction">
  532.         ''' The system-wide parameter to be retrieved or set.
  533.         ''' </param>
  534.         '''
  535.         ''' <param name="uiParam">
  536.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  537.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  538.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  539.         ''' </param>
  540.         '''
  541.         ''' <param name="pvParam">
  542.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  543.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  544.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  545.         ''' For information on the PVOID datatype, see Windows Data Types.
  546.         ''' </param>
  547.         '''
  548.         ''' <param name="fWinIni">
  549.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  550.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  551.         ''' all top-level windows to notify them of the change.
  552.         '''
  553.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  554.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  555.         ''' </param>
  556.         ''' ----------------------------------------------------------------------------------------------------
  557.         ''' <returns>
  558.         ''' If the function succeeds, the return value is a nonzero value.
  559.         ''' If the function fails, the return value is zero.
  560.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  561.         ''' </returns>
  562.         ''' ----------------------------------------------------------------------------------------------------
  563.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  564.         ''' ----------------------------------------------------------------------------------------------------
  565.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  566.         Friend Shared Function SystemParametersInfo(
  567.                                ByVal uiAction As SystemParametersActionFlags,
  568.                                ByVal uiParam As UInteger,
  569.                                ByVal pvParam As String,
  570.                                ByVal fWinIni As SystemParametersWinIniFlags
  571.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  572.         End Function
  573.  
  574.         ''' ----------------------------------------------------------------------------------------------------
  575.         ''' <summary>
  576.         ''' Retrieves or sets the value of one of the system-wide parameters.
  577.         ''' This function can also update the user profile while setting a parameter.
  578.         ''' </summary>
  579.         ''' ----------------------------------------------------------------------------------------------------
  580.         ''' <param name="uiAction">
  581.         ''' The system-wide parameter to be retrieved or set.
  582.         ''' </param>
  583.         '''
  584.         ''' <param name="uiParam">
  585.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  586.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  587.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  588.         ''' </param>
  589.         '''
  590.         ''' <param name="pvParam">
  591.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  592.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  593.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  594.         ''' For information on the PVOID datatype, see Windows Data Types.
  595.         ''' </param>
  596.         '''
  597.         ''' <param name="fWinIni">
  598.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  599.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  600.         ''' all top-level windows to notify them of the change.
  601.         '''
  602.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  603.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  604.         ''' </param>
  605.         ''' ----------------------------------------------------------------------------------------------------
  606.         ''' <returns>
  607.         ''' If the function succeeds, the return value is a nonzero value.
  608.         ''' If the function fails, the return value is zero.
  609.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  610.         ''' </returns>
  611.         ''' ----------------------------------------------------------------------------------------------------
  612.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  613.         ''' ----------------------------------------------------------------------------------------------------
  614.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  615.         Friend Shared Function SystemParametersInfo(
  616.                                ByVal uiAction As SystemParametersActionFlags,
  617.                                ByVal uiParam As UInteger,
  618.                   <[In]> <Out> ByVal pvParam As StringBuilder,
  619.                                ByVal fWinIni As SystemParametersWinIniFlags
  620.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  621.         End Function
  622.  
  623.         ''' ----------------------------------------------------------------------------------------------------
  624.         ''' <summary>
  625.         ''' Retrieves or sets the value of one of the system-wide parameters.
  626.         ''' This function can also update the user profile while setting a parameter.
  627.         ''' </summary>
  628.         ''' ----------------------------------------------------------------------------------------------------
  629.         ''' <param name="uiAction">
  630.         ''' The system-wide parameter to be retrieved or set.
  631.         ''' </param>
  632.         '''
  633.         ''' <param name="uiParam">
  634.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  635.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  636.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  637.         ''' </param>
  638.         '''
  639.         ''' <param name="pvParam">
  640.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  641.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  642.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  643.         ''' For information on the PVOID datatype, see Windows Data Types.
  644.         ''' </param>
  645.         '''
  646.         ''' <param name="fWinIni">
  647.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  648.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  649.         ''' all top-level windows to notify them of the change.
  650.         '''
  651.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  652.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  653.         ''' </param>
  654.         ''' ----------------------------------------------------------------------------------------------------
  655.         ''' <returns>
  656.         ''' If the function succeeds, the return value is a nonzero value.
  657.         ''' If the function fails, the return value is zero.
  658.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  659.         ''' </returns>
  660.         ''' ----------------------------------------------------------------------------------------------------
  661.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  662.         ''' ----------------------------------------------------------------------------------------------------
  663.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  664.         Friend Shared Function SystemParametersInfo(
  665.                                ByVal uiAction As SystemParametersActionFlags,
  666.                                ByVal uiParam As UInteger,
  667.                                ByRef pvParam As Boolean,
  668.                                ByVal fWinIni As SystemParametersWinIniFlags
  669.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  670.         End Function
  671.  
  672.         ''' ----------------------------------------------------------------------------------------------------
  673.         ''' <summary>
  674.         ''' Retrieves or sets the value of one of the system-wide parameters.
  675.         ''' This function can also update the user profile while setting a parameter.
  676.         ''' </summary>
  677.         ''' ----------------------------------------------------------------------------------------------------
  678.         ''' <param name="uiAction">
  679.         ''' The system-wide parameter to be retrieved or set.
  680.         ''' </param>
  681.         '''
  682.         ''' <param name="uiParam">
  683.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  684.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  685.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  686.         ''' </param>
  687.         '''
  688.         ''' <param name="pvParam">
  689.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  690.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  691.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  692.         ''' For information on the PVOID datatype, see Windows Data Types.
  693.         ''' </param>
  694.         '''
  695.         ''' <param name="fWinIni">
  696.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  697.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  698.         ''' all top-level windows to notify them of the change.
  699.         '''
  700.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  701.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  702.         ''' </param>
  703.         ''' ----------------------------------------------------------------------------------------------------
  704.         ''' <returns>
  705.         ''' If the function succeeds, the return value is a nonzero value.
  706.         ''' If the function fails, the return value is zero.
  707.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  708.         ''' </returns>
  709.         ''' ----------------------------------------------------------------------------------------------------
  710.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  711.         ''' ----------------------------------------------------------------------------------------------------
  712.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  713.         Friend Shared Function SystemParametersInfo(
  714.                                ByVal uiAction As SystemParametersActionFlags,
  715.                                ByVal uiParam As Boolean,
  716.                                ByVal pvParam As UInteger,
  717.                                ByVal fWinIni As SystemParametersWinIniFlags
  718.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  719.         End Function
  720.  
  721.         ''' ----------------------------------------------------------------------------------------------------
  722.         ''' <summary>
  723.         ''' Retrieves or sets the value of one of the system-wide parameters.
  724.         ''' This function can also update the user profile while setting a parameter.
  725.         ''' </summary>
  726.         ''' ----------------------------------------------------------------------------------------------------
  727.         ''' <param name="uiAction">
  728.         ''' The system-wide parameter to be retrieved or set.
  729.         ''' </param>
  730.         '''
  731.         ''' <param name="uiParam">
  732.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  733.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  734.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  735.         ''' </param>
  736.         '''
  737.         ''' <param name="pvParam">
  738.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  739.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  740.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  741.         ''' For information on the PVOID datatype, see Windows Data Types.
  742.         ''' </param>
  743.         '''
  744.         ''' <param name="fWinIni">
  745.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  746.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  747.         ''' all top-level windows to notify them of the change.
  748.         '''
  749.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  750.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  751.         ''' </param>
  752.         ''' ----------------------------------------------------------------------------------------------------
  753.         ''' <returns>
  754.         ''' If the function succeeds, the return value is a nonzero value.
  755.         ''' If the function fails, the return value is zero.
  756.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  757.         ''' </returns>
  758.         ''' ----------------------------------------------------------------------------------------------------
  759.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  760.         ''' ----------------------------------------------------------------------------------------------------
  761.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  762.         Friend Shared Function SystemParametersInfo(
  763.                                ByVal uiAction As SystemParametersActionFlags,
  764.                                ByVal uiParam As UInteger,
  765.                                ByRef pvParam As UInteger,
  766.                                ByVal fWinIni As SystemParametersWinIniFlags
  767.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  768.         End Function
  769.  
  770.         ''' ----------------------------------------------------------------------------------------------------
  771.         ''' <summary>
  772.         ''' Retrieves or sets the value of one of the system-wide parameters.
  773.         ''' This function can also update the user profile while setting a parameter.
  774.         ''' </summary>
  775.         ''' ----------------------------------------------------------------------------------------------------
  776.         ''' <param name="uiAction">
  777.         ''' The system-wide parameter to be retrieved or set.
  778.         ''' </param>
  779.         '''
  780.         ''' <param name="uiParam">
  781.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  782.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  783.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  784.         ''' </param>
  785.         '''
  786.         ''' <param name="pvParam">
  787.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  788.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  789.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  790.         ''' For information on the PVOID datatype, see Windows Data Types.
  791.         ''' </param>
  792.         '''
  793.         ''' <param name="fWinIni">
  794.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  795.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  796.         ''' all top-level windows to notify them of the change.
  797.         '''
  798.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  799.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  800.         ''' </param>
  801.         ''' ----------------------------------------------------------------------------------------------------
  802.         ''' <returns>
  803.         ''' If the function succeeds, the return value is a nonzero value.
  804.         ''' If the function fails, the return value is zero.
  805.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  806.         ''' </returns>
  807.         ''' ----------------------------------------------------------------------------------------------------
  808.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  809.         ''' ----------------------------------------------------------------------------------------------------
  810.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  811.         Friend Shared Function SystemParametersInfo(
  812.                                ByVal uiAction As SystemParametersActionFlags,
  813.                                ByVal uiParam As Integer,
  814.                                ByVal pvParam As UInteger,
  815.                                ByVal fWinIni As SystemParametersWinIniFlags
  816.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  817.         End Function
  818.  
  819.         ''' ----------------------------------------------------------------------------------------------------
  820.         ''' <summary>
  821.         ''' Retrieves or sets the value of one of the system-wide parameters.
  822.         ''' This function can also update the user profile while setting a parameter.
  823.         ''' </summary>
  824.         ''' ----------------------------------------------------------------------------------------------------
  825.         ''' <param name="uiAction">
  826.         ''' The system-wide parameter to be retrieved or set.
  827.         ''' </param>
  828.         '''
  829.         ''' <param name="uiParam">
  830.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  831.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  832.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  833.         ''' </param>
  834.         '''
  835.         ''' <param name="pvParam">
  836.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  837.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  838.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  839.         ''' For information on the PVOID datatype, see Windows Data Types.
  840.         ''' </param>
  841.         '''
  842.         ''' <param name="fWinIni">
  843.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  844.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  845.         ''' all top-level windows to notify them of the change.
  846.         '''
  847.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  848.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  849.         ''' </param>
  850.         ''' ----------------------------------------------------------------------------------------------------
  851.         ''' <returns>
  852.         ''' If the function succeeds, the return value is a nonzero value.
  853.         ''' If the function fails, the return value is zero.
  854.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  855.         ''' </returns>
  856.         ''' ----------------------------------------------------------------------------------------------------
  857.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  858.         ''' ----------------------------------------------------------------------------------------------------
  859.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  860.         Friend Shared Function SystemParametersInfo(
  861.                                ByVal uiAction As SystemParametersActionFlags,
  862.                                ByVal uiParam As UInteger,
  863.                                ByVal pvParam As Integer,
  864.                                ByVal fWinIni As SystemParametersWinIniFlags
  865.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  866.         End Function
  867.  
  868.         ''' ----------------------------------------------------------------------------------------------------
  869.         ''' <summary>
  870.         ''' Retrieves or sets the value of one of the system-wide parameters.
  871.         ''' This function can also update the user profile while setting a parameter.
  872.         ''' </summary>
  873.         ''' ----------------------------------------------------------------------------------------------------
  874.         ''' <param name="uiAction">
  875.         ''' The system-wide parameter to be retrieved or set.
  876.         ''' </param>
  877.         '''
  878.         ''' <param name="uiParam">
  879.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  880.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  881.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  882.         ''' </param>
  883.         '''
  884.         ''' <param name="pvParam">
  885.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  886.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  887.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  888.         ''' For information on the PVOID datatype, see Windows Data Types.
  889.         ''' </param>
  890.         '''
  891.         ''' <param name="fWinIni">
  892.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  893.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  894.         ''' all top-level windows to notify them of the change.
  895.         '''
  896.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  897.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  898.         ''' </param>
  899.         ''' ----------------------------------------------------------------------------------------------------
  900.         ''' <returns>
  901.         ''' If the function succeeds, the return value is a nonzero value.
  902.         ''' If the function fails, the return value is zero.
  903.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  904.         ''' </returns>
  905.         ''' ----------------------------------------------------------------------------------------------------
  906.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  907.         ''' ----------------------------------------------------------------------------------------------------
  908.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  909.         Friend Shared Function SystemParametersInfo(
  910.                                ByVal uiAction As SystemParametersActionFlags,
  911.                                ByVal uiParam As Integer,
  912.                                ByVal pvParam As Boolean,
  913.                                ByVal fWinIni As SystemParametersWinIniFlags
  914.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  915.         End Function
  916.  
  917.         ''' ----------------------------------------------------------------------------------------------------
  918.         ''' <summary>
  919.         ''' Retrieves or sets the value of one of the system-wide parameters.
  920.         ''' This function can also update the user profile while setting a parameter.
  921.         ''' </summary>
  922.         ''' ----------------------------------------------------------------------------------------------------
  923.         ''' <param name="uiAction">
  924.         ''' The system-wide parameter to be retrieved or set.
  925.         ''' </param>
  926.         '''
  927.         ''' <param name="uiParam">
  928.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  929.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  930.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  931.         ''' </param>
  932.         '''
  933.         ''' <param name="pvParam">
  934.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  935.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  936.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  937.         ''' For information on the PVOID datatype, see Windows Data Types.
  938.         ''' </param>
  939.         '''
  940.         ''' <param name="fWinIni">
  941.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  942.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  943.         ''' all top-level windows to notify them of the change.
  944.         '''
  945.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  946.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  947.         ''' </param>
  948.         ''' ----------------------------------------------------------------------------------------------------
  949.         ''' <returns>
  950.         ''' If the function succeeds, the return value is a nonzero value.
  951.         ''' If the function fails, the return value is zero.
  952.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  953.         ''' </returns>
  954.         ''' ----------------------------------------------------------------------------------------------------
  955.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  956.         ''' ----------------------------------------------------------------------------------------------------
  957.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  958.         Friend Shared Function SystemParametersInfo(
  959.                                ByVal uiAction As SystemParametersActionFlags,
  960.                                ByVal uiParam As UInteger,
  961.                                ByRef pvParam As UShort,
  962.                                ByVal fWinIni As SystemParametersWinIniFlags
  963.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  964.         End Function
  965.  
  966.         ''' ----------------------------------------------------------------------------------------------------
  967.         ''' <summary>
  968.         ''' Retrieves or sets the value of one of the system-wide parameters.
  969.         ''' This function can also update the user profile while setting a parameter.
  970.         ''' </summary>
  971.         ''' ----------------------------------------------------------------------------------------------------
  972.         ''' <param name="uiAction">
  973.         ''' The system-wide parameter to be retrieved or set.
  974.         ''' </param>
  975.         '''
  976.         ''' <param name="uiParam">
  977.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  978.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  979.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  980.         ''' </param>
  981.         '''
  982.         ''' <param name="pvParam">
  983.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  984.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  985.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  986.         ''' For information on the PVOID datatype, see Windows Data Types.
  987.         ''' </param>
  988.         '''
  989.         ''' <param name="fWinIni">
  990.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  991.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  992.         ''' all top-level windows to notify them of the change.
  993.         '''
  994.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  995.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  996.         ''' </param>
  997.         ''' ----------------------------------------------------------------------------------------------------
  998.         ''' <returns>
  999.         ''' If the function succeeds, the return value is a nonzero value.
  1000.         ''' If the function fails, the return value is zero.
  1001.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  1002.         ''' </returns>
  1003.         ''' ----------------------------------------------------------------------------------------------------
  1004.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  1005.         ''' ----------------------------------------------------------------------------------------------------
  1006.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  1007.         Friend Shared Function SystemParametersInfo(
  1008.                                ByVal uiAction As SystemParametersActionFlags,
  1009.                                ByVal uiParam As UInteger,
  1010.                                ByRef pvParam As ULong,
  1011.                                ByVal fWinIni As SystemParametersWinIniFlags
  1012.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  1013.         End Function
  1014.  
  1015.         ''' ----------------------------------------------------------------------------------------------------
  1016.         ''' <summary>
  1017.         ''' Retrieves or sets the value of one of the system-wide parameters.
  1018.         ''' This function can also update the user profile while setting a parameter.
  1019.         ''' </summary>
  1020.         ''' ----------------------------------------------------------------------------------------------------
  1021.         ''' <param name="uiAction">
  1022.         ''' The system-wide parameter to be retrieved or set.
  1023.         ''' </param>
  1024.         '''
  1025.         ''' <param name="uiParam">
  1026.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  1027.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  1028.         ''' If not otherwise indicated, you must specify '0' for this parameter.
  1029.         ''' </param>
  1030.         '''
  1031.         ''' <param name="pvParam">
  1032.         ''' A parameter whose usage and format depends on the system parameter being queried or set.
  1033.         ''' For more information about system-wide parameters, see the <paramfer name="uiAction"></paramfer> parameter.
  1034.         ''' If not otherwise indicated, you must specify <c>Nothing</c> for this parameter.
  1035.         ''' For information on the PVOID datatype, see Windows Data Types.
  1036.         ''' </param>
  1037.         '''
  1038.         ''' <param name="fWinIni">
  1039.         ''' If a system parameter is being set, specifies whether the user profile is to be updated,
  1040.         ''' and if so, whether the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message is to be broadcast to
  1041.         ''' all top-level windows to notify them of the change.
  1042.         '''
  1043.         ''' This parameter can be '0' if you do not want to update the user profile or broadcast the
  1044.         ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message.
  1045.         ''' </param>
  1046.         ''' ----------------------------------------------------------------------------------------------------
  1047.         ''' <returns>
  1048.         ''' If the function succeeds, the return value is a nonzero value.
  1049.         ''' If the function fails, the return value is zero.
  1050.         ''' To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
  1051.         ''' </returns>
  1052.         ''' ----------------------------------------------------------------------------------------------------
  1053.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx</remarks>
  1054.         ''' ----------------------------------------------------------------------------------------------------
  1055.         <DllImport("user32.dll", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  1056.         Friend Shared Function SystemParametersInfo(
  1057.                                ByVal uiAction As SystemParametersActionFlags,
  1058.                                ByVal uiParam As UInteger,
  1059.                                ByVal pvParam As Long,
  1060.                                ByVal fWinIni As SystemParametersWinIniFlags
  1061.         ) As <MarshalAs(UnmanagedType.Bool)> Boolean
  1062.         End Function
  1063.  
  1064. #End Region
  1065.  
  1066. #Region " Methods "
  1067.  
  1068.         ''' ----------------------------------------------------------------------------------------------------
  1069.         ''' <summary>
  1070.         ''' Notifies the system of an event that an application has performed.
  1071.         ''' An application should use this function if it performs an action that may affect the Shell.
  1072.         ''' </summary>
  1073.         ''' ----------------------------------------------------------------------------------------------------
  1074.         ''' <param name="wEventId">
  1075.         ''' Describes the event that has occurred.
  1076.         ''' Typically, only one event is specified at a time.
  1077.         ''' If more than one event is specified, the values contained in the dwItem1 and dwItem2 parameters must be the same, respectively, for all specified events.
  1078.         ''' </param>
  1079.         '''
  1080.         ''' <param name="uFlags">
  1081.         ''' Flags that, when combined bitwise with SHCNF_TYPE,
  1082.         ''' indicate the meaning of the dwItem1 and dwItem2 parameters.
  1083.         ''' </param>
  1084.         '''
  1085.         ''' <param name="dwItem1">
  1086.         ''' Optional.
  1087.         ''' First event-dependent value.
  1088.         ''' </param>
  1089.         '''
  1090.         ''' <param name="dwItem2">
  1091.         ''' Optional.
  1092.         ''' Second event-dependent value.
  1093.         ''' </param>
  1094.         ''' ----------------------------------------------------------------------------------------------------
  1095.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb762118%28v=vs.85%29.aspx</remarks>
  1096.         ''' ----------------------------------------------------------------------------------------------------
  1097.         <DllImport("shell32.dll", EntryPoint:="SHChangeNotify", SetLastError:=True, CharSet:=CharSet.Auto, BestFitMapping:=False, ThrowOnUnmappableChar:=True)>
  1098.         Friend Shared Sub SHChangeNotify(
  1099.                       ByVal wEventId As EnvironmentUtil.NativeMethods.SHChangeNotifyEventID,
  1100.                       ByVal uFlags As EnvironmentUtil.NativeMethods.SHChangeNotifyFlags,
  1101.                       ByVal dwItem1 As String,
  1102.                       ByVal dwItem2 As String)
  1103.         End Sub
  1104.  
  1105. #End Region
  1106.  
  1107. #Region " Enumerations "
  1108.  
  1109.         ''' ----------------------------------------------------------------------------------------------------
  1110.         ''' <summary>
  1111.         ''' Flags for <paramref name="fuFlags"/> parameter of <see cref="EnvironmentUtil.NativeMethods.SendMessageTimeout"/> function.
  1112.         ''' </summary>
  1113.         ''' ----------------------------------------------------------------------------------------------------
  1114.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms644952%28v=vs.85%29.aspx</remarks>
  1115.         ''' ----------------------------------------------------------------------------------------------------
  1116.         <Flags()>
  1117.         Friend Enum SendMessageTimeoutFlags As Integer
  1118.  
  1119.             ''' <summary>
  1120.             ''' The calling thread is not prevented from processing other requests while waiting for the function to return.
  1121.             ''' </summary>
  1122.             Normal = &H0
  1123.  
  1124.             ''' <summary>
  1125.             ''' Prevents the calling thread from processing any other requests until the function returns.
  1126.             ''' </summary>
  1127.             Block = &H1
  1128.  
  1129.             ''' <summary>
  1130.             ''' The function returns without waiting for the time-out period to elapse if the receiving thread appears to not respond or "hangs."
  1131.             ''' </summary>
  1132.             AbortIfHung = &H2
  1133.  
  1134.             ''' <summary>
  1135.             ''' The function does not enforce the time-out period  as long as the receiving thread is processing messages.
  1136.             ''' </summary>
  1137.             NoTimeoutIfNotHung = &H8
  1138.  
  1139.             ''' <summary>
  1140.             ''' The function should return 0 if the receiving window is destroyed or its owning thread dies while the message is being processed.
  1141.             ''' </summary>
  1142.             ErrorOnExit = &H20
  1143.  
  1144.         End Enum
  1145.  
  1146.         ''' ----------------------------------------------------------------------------------------------------
  1147.         ''' <summary>
  1148.         ''' Flags for <paramref name="fWinIni"/> parameter of <see cref="EnvironmentUtil.NativeMethods.SetSystemCursor"/> function.
  1149.         ''' </summary>
  1150.         ''' ----------------------------------------------------------------------------------------------------
  1151.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms648395%28v=vs.85%29.aspx</remarks>
  1152.         ''' ----------------------------------------------------------------------------------------------------
  1153.         Friend Enum SystemCursorId As Short
  1154.  
  1155.             ''' <summary>
  1156.             ''' Standard arrow and small hourglass.
  1157.             ''' </summary>
  1158.             AppStarting = 32650S
  1159.  
  1160.             ''' <summary>
  1161.             ''' Standard arrow.
  1162.             ''' </summary>
  1163.             Arrow = 32512S
  1164.  
  1165.             ''' <summary>
  1166.             ''' Crosshair.
  1167.             ''' </summary>
  1168.             Crosshair = 32515S
  1169.  
  1170.             ''' <summary>
  1171.             ''' Hand.
  1172.             ''' </summary>
  1173.             Hand = 32649S
  1174.  
  1175.             ''' <summary>
  1176.             ''' Arrow and question mark.
  1177.             ''' </summary>
  1178.             Help = 32651S
  1179.  
  1180.             ''' <summary>
  1181.             ''' I-beam.
  1182.             ''' </summary>
  1183.             IBeam = 32513S
  1184.  
  1185.             ''' <summary>
  1186.             ''' Slashed circle.
  1187.             ''' </summary>
  1188.             No = 32648S
  1189.  
  1190.             ''' <summary>
  1191.             ''' Four-pointed arrow pointing north, south, east, and west.
  1192.             ''' </summary>
  1193.             SizeAll = 32646S
  1194.  
  1195.             ''' <summary>
  1196.             ''' Double-pointed arrow pointing northeast and southwest.
  1197.             ''' </summary>
  1198.             Size_NESW = 32643S
  1199.  
  1200.             ''' <summary>
  1201.             ''' Double-pointed arrow pointing north and south.
  1202.             ''' </summary>
  1203.             Size_NS = 32645S
  1204.  
  1205.             ''' <summary>
  1206.             ''' Double-pointed arrow pointing northwest and southeast.
  1207.             ''' </summary>
  1208.             Size_NWSE = 32642S
  1209.  
  1210.             ''' <summary>
  1211.             ''' Double-pointed arrow pointing west and east.
  1212.             ''' </summary>
  1213.             Size_WE = 32644S
  1214.  
  1215.             ''' <summary>
  1216.             ''' Vertical arrow.
  1217.             ''' </summary>
  1218.             Up = 32516S
  1219.  
  1220.             ''' <summary>
  1221.             ''' Hourglass.
  1222.             ''' </summary>
  1223.             Wait = 32514S
  1224.  
  1225.         End Enum
  1226.  
  1227.         ''' ----------------------------------------------------------------------------------------------------
  1228.         ''' <summary>
  1229.         ''' Flags for <paramref name="wEventId"/> parameter of <see cref="EnvironmentUtil.NativeMethods.SHChangeNotify"/> method.
  1230.         ''' </summary>
  1231.         ''' ----------------------------------------------------------------------------------------------------
  1232.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb762118%28v=vs.85%29.aspx</remarks>
  1233.         ''' ----------------------------------------------------------------------------------------------------
  1234.         <Flags>
  1235.         Friend Enum SHChangeNotifyEventID As UInteger
  1236.  
  1237.             ''' <summary>
  1238.             ''' All events have occurred.
  1239.             ''' </summary>
  1240.             AllEvents = &H7FFFFFFFUI
  1241.  
  1242.             ''' <summary>
  1243.             ''' A folder has been created.
  1244.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1245.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1246.             ''' <paramref name="dwItem1"/> contains the folder that was created.
  1247.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1248.             ''' </summary>
  1249.             DirectoryCreated = &H8UI
  1250.  
  1251.             ''' <summary>
  1252.             ''' A folder has been removed.
  1253.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1254.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1255.             ''' <paramref name="dwItem1"/> contains the folder that was removed.
  1256.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1257.             ''' </summary>
  1258.             DirectoryDeleted = &H10UI
  1259.  
  1260.             ''' <summary>
  1261.             ''' The name of a folder has changed.
  1262.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1263.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1264.             ''' <paramref name="dwItem1"/> contains the previous pointer to an item identifier list (PIDL) or name of the folder.
  1265.             ''' <paramref name="dwItem2"/> contains the new PIDL or name of the folder.
  1266.             ''' </summary>
  1267.             DirectoryRenamed = &H20000UI
  1268.  
  1269.             ''' <summary>
  1270.             ''' A non-folder item has been created.
  1271.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1272.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1273.             ''' <paramref name="dwItem1"/> contains the item that was created.
  1274.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1275.             ''' </summary>
  1276.             ItemCreated = &H2UI
  1277.  
  1278.             ''' <summary>
  1279.             ''' A nonfolder item has been deleted.
  1280.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1281.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1282.             ''' <paramref name="dwItem1"/> contains the item that was deleted.
  1283.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1284.             ''' </summary>
  1285.             ItemDeleted = &H4UI
  1286.  
  1287.             ''' <summary>
  1288.             ''' The name of a nonfolder item has changed.
  1289.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1290.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1291.             ''' <paramref name="dwItem1"/> contains the previous PIDL or name of the item.
  1292.             ''' <paramref name="dwItem2"/> contains the new PIDL or name of the item.
  1293.             ''' </summary>
  1294.             ItemRenamed = &H1UI
  1295.  
  1296.             ''' <summary>
  1297.             ''' A drive has been added.
  1298.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1299.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1300.             ''' <paramref name="dwItem1"/> contains the root of the drive that was added.
  1301.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1302.             ''' </summary>
  1303.             DriveAdded = &H100UI
  1304.  
  1305.             ''' <summary>
  1306.             ''' A drive has been added and the Shell should create a new window for the drive.
  1307.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1308.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1309.             ''' <paramref name="dwItem1"/> contains the root of the drive that was added.
  1310.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1311.             ''' </summary>
  1312.             DriveAddedShell = &H10000UI
  1313.  
  1314.             ''' <summary>
  1315.             ''' A drive has been removed.
  1316.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1317.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1318.             ''' <paramref name="dwItem1"/> contains the root of the drive that was removed.
  1319.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1320.             ''' </summary>
  1321.             DriveRemoved = &H80UI
  1322.  
  1323.             ''' <summary>
  1324.             ''' Storage media has been inserted into a drive.
  1325.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1326.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1327.             ''' <paramref name="dwItem1"/> contains the root of the drive that contains the new media.
  1328.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1329.             ''' </summary>
  1330.             MediaInserted = &H20UI
  1331.  
  1332.             ''' <summary>
  1333.             ''' Storage media has been removed from a drive.
  1334.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1335.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1336.             ''' <paramref name="dwItem1"/> contains the root of the drive from which the media was removed.
  1337.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1338.             ''' </summary>
  1339.             MediaRemoved = &H40UI
  1340.  
  1341.             ''' <summary>
  1342.             ''' A folder on the local computer is being shared via the network.
  1343.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1344.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1345.             ''' <paramref name="dwItem1"/> contains the folder that is being shared.
  1346.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1347.             ''' </summary>
  1348.             NetShared = &H200UI
  1349.  
  1350.             ''' <summary>
  1351.             ''' A folder on the local computer is no longer being shared via the network.
  1352.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1353.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1354.             ''' <paramref name="dwItem1"/> contains the folder that is no longer being shared.
  1355.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1356.             ''' </summary>
  1357.             NetUnshared = &H400UI
  1358.  
  1359.             ''' <summary>
  1360.             ''' The computer has disconnected from a server.
  1361.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1362.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1363.             ''' <paramref name="dwItem1"/> contains the server from which the computer was disconnected.
  1364.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1365.             ''' </summary>
  1366.             ServerDisconnected = &H4000UI
  1367.  
  1368.             ''' <summary>
  1369.             ''' The attributes of an item or folder have changed.
  1370.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1371.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1372.             ''' <paramref name="dwItem1"/> contains the item or folder that has changed.
  1373.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1374.             ''' </summary>
  1375.             ItemAttributesChanged = &H800UI
  1376.  
  1377.             ''' <summary>
  1378.             ''' A file type association has changed.
  1379.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> must be specified in the <paramref name="uFlags"/> parameter.
  1380.             ''' <paramref name="dwItem1"/> and <paramref name="dwItem2"/> are not used and must be set as <see cref="IntPtr.Zero"/>.
  1381.             ''' </summary>
  1382.             FileAssocChanged = &H8000000UI
  1383.  
  1384.             ''' <summary>
  1385.             ''' The amount of free space on a drive has changed.
  1386.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1387.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1388.             ''' <paramref name="dwItem1"/> contains the root of the drive on which the free space changed.
  1389.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1390.             ''' </summary>
  1391.             FreespaceChanged = &H40000UI
  1392.  
  1393.             ''' <summary>
  1394.             ''' The contents of an existing folder have changed but the folder still exists and has not been renamed.
  1395.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIDList"/> or
  1396.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA"/> must be specified in <paramref name="uFlags"/>.
  1397.             ''' <paramref name="dwItem1"/> contains the folder that has changed.
  1398.             ''' <paramref name="dwItem2"/> is not used and should be <see cref="IntPtr.Zero"/>.
  1399.             ''' If a folder has been created, deleted or renamed use <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DirectoryCreated"/>,
  1400.             ''' or <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DirectoryRenamed"/> respectively instead.
  1401.             ''' </summary>
  1402.             UpdateDirectory = &H1000UI
  1403.  
  1404.             ''' <summary>
  1405.             ''' An image in the system image list has changed.
  1406.             ''' <see cref="EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.DWORD"/> must be specified in <paramref name="uFlags"/>.
  1407.             ''' </summary>
  1408.             UpdateImage = &H8000UI
  1409.  
  1410.         End Enum
  1411.  
  1412.         ''' ----------------------------------------------------------------------------------------------------
  1413.         ''' <summary>
  1414.         ''' Flags for <paramref name="uFlags"/> parameter of <see cref="EnvironmentUtil.NativeMethods.SHChangeNotify"/> method.
  1415.         ''' </summary>
  1416.         ''' ----------------------------------------------------------------------------------------------------
  1417.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb762118%28v=vs.85%29.aspx</remarks>
  1418.         ''' ----------------------------------------------------------------------------------------------------
  1419.         <Flags()>
  1420.         Friend Enum SHChangeNotifyFlags
  1421.  
  1422.             ''' <summary>
  1423.             ''' The <paramref name="dwItem1"/> and <paramref name="dwItem2"/> parameters are DWORD values.
  1424.             ''' </summary>
  1425.             Dword = &H3
  1426.  
  1427.             ''' <summary>
  1428.             ''' <paramref name="dwItem1"/> and <paramref name="dwItem2"/> are the addresses of 'ITEMIDLIST' structures that
  1429.             ''' represent the item(s) affected by the change.
  1430.             ''' Each 'ITEMIDLIST' must be relative to the desktop folder.
  1431.             ''' </summary>
  1432.             ItemIdList = &H0UI
  1433.  
  1434.             ''' <summary>
  1435.             ''' <paramref name="dwItem1"/> and <paramref name="dwItem2"/> are the addresses of null-terminated strings,
  1436.             ''' of maximum length MAX_PATH that contain the full path names of the items affected by the change.
  1437.             ''' </summary>
  1438.             PathA = &H1
  1439.  
  1440.             ''' <summary>
  1441.             ''' <paramref name="dwItem1"/> and <paramref name="dwItem2"/> are the addresses of null-terminated strings,
  1442.             ''' of maximum length MAX_PATH that contain the full path names of the items affected by the change.
  1443.             ''' </summary>
  1444.             PathW = &H5
  1445.  
  1446.             ''' <summary>
  1447.             ''' <paramref name="dwItem1"/> and <paramref name="dwItem2"/> are the addresses of null-terminated strings,
  1448.             ''' that represent the friendly names of the printer(s) affected by the change.
  1449.             ''' </summary>
  1450.             PrinterA = &H2
  1451.  
  1452.             ''' <summary>
  1453.             ''' <paramref name="dwItem1"/> and <paramref name="dwItem2"/> are the addresses of null-terminated strings,
  1454.             ''' that represent the friendly names of the printer(s) affected by the change.
  1455.             ''' </summary>
  1456.             PrinterW = &H6
  1457.  
  1458.             ''' <summary>
  1459.             ''' The function should not return until the notification has been delivered to all affected components.
  1460.             ''' As this flag modifies other data-type flags it cannot by used by itself.
  1461.             ''' </summary>
  1462.             Flush = &H1000
  1463.  
  1464.             ''' <summary>
  1465.             ''' The function should begin delivering notifications to all affected components,
  1466.             ''' but should return as soon as the notification process has begun.
  1467.             ''' As this flag modifies other data-type flags it cannot by used by itself.
  1468.             ''' </summary>
  1469.             FlushNoWait = &H2000
  1470.  
  1471.         End Enum
  1472.  
  1473.         ''' ----------------------------------------------------------------------------------------------------
  1474.         ''' <summary>
  1475.         ''' Flags for <paramref name="uiAction"/> parameter of <see cref="EnvironmentUtil.NativeMethods.SystemParametersInfo"/> function.
  1476.         ''' </summary>
  1477.         ''' ----------------------------------------------------------------------------------------------------
  1478.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx</remarks>
  1479.         ''' ----------------------------------------------------------------------------------------------------
  1480.         Friend Enum SystemParametersActionFlags As UInteger
  1481.  
  1482.             ''' <summary>
  1483.             ''' Determines whether the warning beeper is on.
  1484.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the beeper is on,
  1485.             ''' or <c>False</c> if it is off.
  1486.             ''' </summary>
  1487.             GetBeep = &H1
  1488.  
  1489.             ''' <summary>
  1490.             ''' Turns the warning beeper on or off.
  1491.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> for on, or <c>False</c> for off.
  1492.             ''' </summary>
  1493.             SetBeep = &H2
  1494.  
  1495.             ''' <summary>
  1496.             ''' Retrieves the border multiplier factor that determines the width of a window's sizing border.
  1497.             ''' The <paramref name="pvParam"/> parameter must point to an <see cref="Integer"/> variable that receives this value.
  1498.             ''' </summary>
  1499.             Getborder = &H5
  1500.  
  1501.             ''' <summary>
  1502.             ''' Sets the border multiplier factor that determines the width of a window's sizing border.
  1503.             ''' The <paramref name="uiParam"/> parameter specifies the new value.
  1504.             ''' </summary>
  1505.             SetBorder = &H6
  1506.  
  1507.             ''' <summary>
  1508.             ''' Retrieves the keyboard repeat-speed setting, which is a value in the range
  1509.             ''' from 0 (approximately 2.5 repetitions per second) through 31 (approximately 30 repetitions per second).
  1510.             ''' The actual repeat rates are hardware-dependent and may vary from a linear scale by as much as 20%.
  1511.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Integer"/> variable that receives the setting
  1512.             ''' </summary>
  1513.             GetKeyboardSpeed = &HA
  1514.  
  1515.             ''' <summary>
  1516.             ''' Sets the keyboard repeat-speed setting.
  1517.             ''' The <paramref name="uiParam"/> parameter must specify a value in the range
  1518.             ''' from 0 (approximately 2.5 repetitions per second) through 31 (approximately 30 repetitions per second).
  1519.             ''' The actual repeat rates are hardware-dependent and may vary from a linear scale by as much as 20%.
  1520.             ''' If <paramref name="uiParam"/> is greater than 31, the parameter is set to 31.
  1521.             ''' </summary>
  1522.             SetKeyboardSpeed = &HB
  1523.  
  1524.             ''' <summary>
  1525.             ''' Sets or retrieves the width, in pixels, of an icon cell.
  1526.             ''' The system uses this rectangle to arrange icons in large icon view.
  1527.             ''' To set this value, set <paramref name="uiParam"/> to the new value and set <paramref name="pvParam"/> to <c>Nothing</c>.
  1528.             ''' You cannot set this value to less than SM_CXICON.
  1529.             ''' To retrieve this value, <paramref name="pvParam"/> must point to an <see cref="Integer"/> that receives the current value.
  1530.             ''' </summary>
  1531.             IconHorizontalSpacing = &HD
  1532.  
  1533.             ''' <summary>
  1534.             ''' Sets or retrieves the height, in pixels, of an icon cell.
  1535.             ''' To set this value, set <paramref name="uiParam"/> to the new value and set <paramref name="pvParam"/> to null.
  1536.             ''' You cannot set this value to less than SM_CYICON.
  1537.             ''' To retrieve this value, <paramref name="pvParam"/> must point to an <see cref="Integer"/> that receives the current value.
  1538.             ''' </summary>
  1539.             IconVerticalSpacing = &H18
  1540.  
  1541.             ''' <summary>
  1542.             ''' Retrieves the screen saver time-out value, in seconds.
  1543.             ''' The <paramref name="pvParam"/> parameter must point to an <see cref="Integer"/> variable that receives the value.
  1544.             ''' </summary>
  1545.             GetScreensaveTimeout = &HE
  1546.  
  1547.             ''' <summary>
  1548.             ''' Sets the screen saver time-out value to the value of the <paramref name="uiParam"/> parameter.
  1549.             ''' This value is the amount of time, in seconds, that the system must be idle before the screen saver activates.
  1550.             ''' </summary>
  1551.             SetScreensaveTimeout = &HF
  1552.  
  1553.             ''' <summary>
  1554.             ''' Sets the state of the screen saver.
  1555.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> to activate screen saving, or <c>False</c> to deactivate it.
  1556.             ''' </summary>
  1557.             SetScreensaveActive = &H11
  1558.  
  1559.             ''' <summary>
  1560.             ''' Sets the desktop wallpaper.
  1561.             ''' The value of the <paramref name="pvParam"/> parameter determines the new wallpaper.
  1562.             ''' To specify a wallpaper bitmap, set <paramref name="pvParam"/> to point to a null-terminated string containing the name of a bitmap file.
  1563.             ''' Setting <paramref name="pvParam"/> to "" removes the wallpaper.
  1564.             ''' Setting <paramref name="pvParam"/> to null reverts to the default wallpaper.
  1565.             ''' </summary>
  1566.             SetDesktopWallpaper = &H14
  1567.  
  1568.             ''' <summary>
  1569.             ''' Retrieves the full path of the bitmap file for the desktop wallpaper.
  1570.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="StringBuilder"/> that receives a null-terminated path string.
  1571.             ''' Set the <paramref name="uiParam"/> parameter to the size, in characters, of the <paramref name="pvParam"/> buffer.
  1572.             ''' The returned string will not exceed <see cref="StringBuilder.MaxCapacity"/> characters.
  1573.             ''' If there is no desktop wallpaper, the returned string is empty.
  1574.             ''' </summary>
  1575.             GetDesktopWallpaper = &H73
  1576.  
  1577.             ''' <summary>
  1578.             ''' Retrieves the keyboard repeat-delay setting,
  1579.             ''' which is a value in the range from 0 (approximately 250 ms delay) through 3 (approximately 1 second delay).
  1580.             ''' The actual delay associated with each value may vary depending on the hardware.
  1581.             ''' The <paramref name="pvParam"/> parameter must point to an <see cref="Integer"/> variable that receives the setting.
  1582.             ''' </summary>
  1583.             GetKeyboardDelay = &H16
  1584.  
  1585.             ''' <summary>
  1586.             ''' Sets the keyboard repeat-delay setting.
  1587.             ''' The <paramref name="uiParam"/> parameter must specify 0, 1, 2, or 3, where zero sets the shortest delay
  1588.             ''' (approximately 250 ms) and 3 sets the longest delay (approximately 1 second).
  1589.             ''' The actual delay associated with each value may vary depending on the hardware.
  1590.             ''' </summary>
  1591.             SetKeyboardDelay = &H17
  1592.  
  1593.             ''' <summary>
  1594.             ''' Determines whether icon-title wrapping is enabled.
  1595.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled,
  1596.             ''' or <c>False</c> otherwise.
  1597.             ''' </summary>
  1598.             GetIconTitleWrap = &H19
  1599.  
  1600.             ''' <summary>
  1601.             ''' Turns icon-title wrapping on or off.
  1602.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> for on, or <c>False</c> for off.
  1603.             ''' </summary>
  1604.             SetIconTitleWrap = &H1A
  1605.  
  1606.             ''' <summary>
  1607.             ''' Determines whether pop-up menus are left-aligned or right-aligned, relative to the corresponding menu-bar item.
  1608.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if left-aligned,
  1609.             ''' or <c>False</c> otherwise.
  1610.             ''' </summary>
  1611.             GetMenuDropAlignment = &H1B
  1612.  
  1613.             ''' <summary>
  1614.             ''' Sets the alignment value of pop-up menus.
  1615.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> for right alignment, or <c>False</c> for left alignment.
  1616.             ''' </summary>
  1617.             SetMenuDropAlignment = &H1C
  1618.  
  1619.             ''' <summary>
  1620.             ''' Sets the width of the double-click rectangle to the value of the <paramref name="uiParam"/> parameter.
  1621.             ''' The double-click rectangle is the rectangle within which the second click of a double-click must
  1622.             ''' fall for it to be registered as a double-click.
  1623.             ''' To retrieve the width of the double-click rectangle, call GetSystemMetrics with the SM_CXDOUBLECLK flag.
  1624.             ''' </summary>
  1625.             SetDoubleClickWidth = &H1D
  1626.  
  1627.             ''' <summary>
  1628.             ''' Sets the height of the double-click rectangle to the value of the <paramref name="uiParam"/> parameter.
  1629.             ''' The double-click rectangle is the rectangle within which the second click of a double-click must
  1630.             ''' fall for it to be registered as a double-click.
  1631.             ''' To retrieve the height of the double-click rectangle, call GetSystemMetrics with the SM_CYDOUBLECLK flag.
  1632.             ''' </summary>
  1633.             SetDoubleClickHeight = &H1E
  1634.  
  1635.             ''' <summary>
  1636.             ''' Sets the double-click time for the mouse to the value of the <paramref name="uiParam"/> parameter.
  1637.             ''' The double-click time is the maximum number of milliseconds that can occur between the
  1638.             ''' first and second clicks of a double-click.
  1639.             ''' You can also call the SetDoubleClickTime function to set the double-click time.
  1640.             ''' To get the current double-click time, call the GetDoubleClickTime function.
  1641.             ''' </summary>
  1642.             SetDoubleclickTime = &H20
  1643.  
  1644.             ''' <summary>
  1645.             ''' Swaps or restores the meaning of the left and right mouse buttons.
  1646.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> to swap the meanings of the buttons, or <c>False</c> to restore their original meanings.
  1647.             ''' </summary>
  1648.             SetMousebuttonSwap = &H21
  1649.  
  1650.             ''' <summary>
  1651.             ''' Determines whether dragging of full windows is enabled.
  1652.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled, or <c>False</c> otherwise.
  1653.             ''' </summary>
  1654.             GetDragFullWindows = &H26
  1655.  
  1656.             ''' <summary>
  1657.             ''' Sets dragging of full windows either on or off.
  1658.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> for on, or <c>False</c> for off.
  1659.             ''' </summary>
  1660.             SetDragFullWindows = &H25
  1661.  
  1662.             ''' <summary>
  1663.             ''' Determines whether the font smoothing feature is enabled.
  1664.             ''' This feature uses font antialiasing to make font curves appear smoother by painting pixels at different gray levels.
  1665.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the feature is enabled,
  1666.             '''  or <c>False</c> if it is not.
  1667.             ''' Windows 95:  This flag is supported only if Windows Plus! is installed. See GETWINDOWSEXTENSION.
  1668.             ''' </summary>
  1669.             GetFontSmoothing = &H4A
  1670.  
  1671.             ''' <summary>
  1672.             ''' Enables or disables the font smoothing feature, which uses font antialiasing to make font curves appear smoother
  1673.             ''' by painting pixels at different gray levels.
  1674.             ''' To enable the feature, set the <paramref name="uiParam"/> parameter to TRUE.
  1675.             ''' To disable the feature, set <paramref name="uiParam"/> to FALSE.
  1676.             ''' </summary>
  1677.             SetFontSmoothing = &H4B
  1678.  
  1679.             ''' <summary>
  1680.             ''' Sets the width, in pixels, of the rectangle used to detect the start of a drag operation.
  1681.             ''' Set <paramref name="uiParam"/> to the new value.
  1682.             ''' To retrieve the drag width, call GetSystemMetrics with the SM_CXDRAG flag.
  1683.             ''' </summary>
  1684.             SetDragWidth = &H4C
  1685.  
  1686.             ''' <summary>
  1687.             ''' Sets the height, in pixels, of the rectangle used to detect the start of a drag operation.
  1688.             ''' Set <paramref name="uiParam"/> to the new value.
  1689.             ''' To retrieve the drag height, call GetSystemMetrics with the SM_CYDRAG flag.
  1690.             ''' </summary>
  1691.             SetDragHeight = &H4D
  1692.  
  1693.             ''' <summary>
  1694.             ''' Reloads the system cursors.
  1695.             ''' Set the <paramref name="uiParam"/> parameter to zero and the <paramref name="pvParam"/> parameter to null.
  1696.             ''' </summary>
  1697.             Setcursors = &H57
  1698.  
  1699.             ''' <summary>
  1700.             ''' Reloads the system icons.
  1701.             ''' Set the <paramref name="uiParam"/> parameter to zero and the <paramref name="pvParam"/> parameter to null.
  1702.             ''' </summary>
  1703.             Seticons = &H58
  1704.  
  1705.             ''' <summary>
  1706.             ''' Retrieves the input locale identifier for the system default input language.
  1707.             ''' The <paramref name="pvParam"/> parameter must point to an HKL variable that receives this value.
  1708.             ''' For more information, see Languages, Locales, and Keyboard Layouts on MSDN.
  1709.             ''' </summary>
  1710.             GetDefaultInputLang = &H59
  1711.  
  1712.             ''' <summary>
  1713.             ''' Sets the default input language for the system shell and applications.
  1714.             ''' The specified language must be displayable using the current system character set.
  1715.             ''' The <paramref name="pvParam"/> parameter must point to an HKL variable that contains the input locale identifier for the default language.
  1716.             ''' For more information, see Languages, Locales, and Keyboard Layouts on MSDN.
  1717.             ''' </summary>
  1718.             SetDefaultInputLang = &H5A
  1719.  
  1720.             ''' <summary>
  1721.             ''' Sets the hot key set for switching between input languages.
  1722.             ''' The <paramref name="uiParam"/> and <paramref name="pvParam"/> parameters are not used.
  1723.             ''' The value sets the shortcut keys in the keyboard property sheets by reading the registry again.
  1724.             ''' The registry must be set before this flag is used.
  1725.             ''' the path in the registry is \HKEY_CURRENT_USER\keyboard layout\toggle.
  1726.             ''' Valid values are "1" = ALT+SHIFT, "2" = CTRL+SHIFT, and "3" = none.
  1727.             ''' </summary>
  1728.             SetLangToggle = &H5B
  1729.  
  1730.             ''' <summary>
  1731.             ''' Determines whether the Mouse Trails feature is enabled.
  1732.             ''' This feature improves the visibility of mouse cursor movements by briefly showing a trail of cursors and quickly erasing them.
  1733.             ''' The <paramref name="pvParam"/> parameter must point to an <see cref="Integer"/> variable that receives a value.
  1734.             ''' If the value is zero or 1, the feature is disabled.
  1735.             ''' If the value is greater than 1, the feature is enabled and the value indicates the number of cursors drawn in the trail.
  1736.             ''' The <paramref name="uiParam"/> parameter is not used.
  1737.             ''' </summary>
  1738.             GetMouseTrails = &H5E
  1739.  
  1740.             ''' <summary>
  1741.             ''' Enables or disables the Mouse Trails feature, which improves the visibility of mouse cursor movements by briefly showing
  1742.             ''' a trail of cursors and quickly erasing them.
  1743.             ''' To disable the feature, set the <paramref name="uiParam"/> parameter to zero or 1.
  1744.             ''' To enable the feature, set <paramref name="uiParam"/> to a value greater than 1 to indicate the number of cursors drawn in the trail.
  1745.             ''' </summary>
  1746.             SetMouseTrails = &H5D
  1747.  
  1748.             ''' <summary>
  1749.             ''' Determines whether the snap-to-default-button feature is enabled.
  1750.             ''' If enabled, the mouse cursor automatically moves to the default button, such as "OK" or "Apply", of a dialog box.
  1751.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the feature is on,
  1752.             ''' or <c>False</c> if it is off.
  1753.             ''' </summary>
  1754.             GetSnapToDefButton = &H5F
  1755.  
  1756.             ''' <summary>
  1757.             ''' Enables or disables the snap-to-default-button feature.
  1758.             ''' If enabled, the mouse cursor automatically moves to the default button, such as "OK" or "Apply", of a dialog box.
  1759.             ''' Set the <paramref name="uiParam"/> parameter to <c>True</c> to enable the feature, or <c>False</c> to disable it.
  1760.             ''' Applications should use the ShowWindow function when displaying a dialog box so the dialog manager can position the mouse cursor.
  1761.             ''' </summary>
  1762.             SetSnapToDefButton = &H60
  1763.  
  1764.             ''' <summary>
  1765.             ''' Retrieves the width, in pixels, of the rectangle within which the mouse pointer has to stay for TrackMouseEvent
  1766.             ''' to generate a WM_MOUSEHOVER message.
  1767.             ''' The <paramref name="pvParam"/> parameter must point to a UINT variable that receives the width.
  1768.             ''' </summary>
  1769.             GetMouseHoverWidth = &H62
  1770.  
  1771.             ''' <summary>
  1772.             ''' Retrieves the width, in pixels, of the rectangle within which the mouse pointer has to stay for TrackMouseEvent
  1773.             ''' to generate a WM_MOUSEHOVER message.
  1774.             ''' The <paramref name="pvParam"/> parameter must point to a UINT variable that receives the width.
  1775.             ''' </summary>
  1776.             SetMouseHoverWidth = &H63
  1777.  
  1778.             ''' <summary>
  1779.             ''' Retrieves the height, in pixels, of the rectangle within which the mouse pointer has to stay for TrackMouseEvent
  1780.             ''' to generate a WM_MOUSEHOVER message.
  1781.             ''' The <paramref name="pvParam"/> parameter must point to a UINT variable that receives the height.
  1782.             ''' </summary>
  1783.             GetMouseHoverHeight = &H64
  1784.  
  1785.             ''' <summary>
  1786.             ''' Sets the height, in pixels, of the rectangle within which the mouse pointer has to stay for TrackMouseEvent
  1787.             ''' to generate a WM_MOUSEHOVER message.
  1788.             ''' Set the <paramref name="uiParam"/> parameter to the new height.
  1789.             ''' </summary>
  1790.             SetMouseHoverHeight = &H65
  1791.  
  1792.             ''' <summary>
  1793.             ''' Retrieves the time, in milliseconds, that the mouse pointer has to stay in the hover rectangle for TrackMouseEvent
  1794.             ''' to generate a WM_MOUSEHOVER message.
  1795.             ''' The <paramref name="pvParam"/> parameter must point to a UINT variable that receives the time.
  1796.             ''' </summary>
  1797.             GetMouseHoverTime = &H66
  1798.  
  1799.             ''' <summary>
  1800.             ''' Sets the time, in milliseconds, that the mouse pointer has to stay in the hover rectangle for TrackMouseEvent
  1801.             ''' to generate a WM_MOUSEHOVER message.
  1802.             ''' This is used only if you pass HOVER_DEFAULT in the dwHoverTime parameter in the call to TrackMouseEvent.
  1803.             ''' Set the <paramref name="uiParam"/> parameter to the new time.
  1804.             ''' </summary>
  1805.             SetMouseHoverTime = &H67
  1806.  
  1807.             ''' <summary>
  1808.             ''' Retrieves the number of lines to scroll when the mouse wheel is rotated.
  1809.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UInteger"/> variable that receives the number of lines.
  1810.             ''' The default value is 3.
  1811.             ''' </summary>
  1812.             GetWheelScrollLines = &H68
  1813.  
  1814.             ''' <summary>
  1815.             ''' Sets the number of lines to scroll when the mouse wheel is rotated.
  1816.             ''' The number of lines is set from the <paramref name="uiParam"/> parameter.
  1817.             ''' The number of lines is the suggested number of lines to scroll when the mouse wheel is rolled without using modifier keys.
  1818.             ''' If the number is 0, then no scrolling should occur.
  1819.             ''' If the number of lines to scroll is greater than the number of lines viewable,
  1820.             ''' and in particular if it is WHEEL_PAGESCROLL (#defined as UINT_MAX), the scroll operation should be interpreted
  1821.             ''' as clicking once in the page down or page up regions of the scroll bar.
  1822.             ''' </summary>
  1823.             SetWheelScrollLines = &H69
  1824.  
  1825.             ''' <summary>
  1826.             ''' Retrieves the time, in milliseconds, that the system waits before displaying a shortcut menu when the mouse cursor is over a submenu item.
  1827.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UShort"/> variable that receives the time of the delay.
  1828.             ''' </summary>
  1829.             GetMenuShowDelay = &H6A
  1830.  
  1831.             ''' <summary>
  1832.             ''' Sets <paramref name="uiParam"/> to the time, in milliseconds, that the system waits before displaying a shortcut menu when the mouse cursor is
  1833.             ''' over a submenu item.
  1834.             ''' </summary>
  1835.             SetMenuShowDelay = &H6B
  1836.  
  1837.             ''' <summary>
  1838.             ''' Retrieves the current mouse speed.
  1839.             ''' The mouse speed determines how far the pointer will move based on the distance the mouse moves.
  1840.             ''' The <paramref name="pvParam"/> parameter must point to an <see cref="Integer"/> variable that receives a value which
  1841.             ''' ranges between 1 (slowest) and 20 (fastest).
  1842.             ''' A value of 10 is the default.
  1843.             ''' The value can be set by an end user using the mouse control panel application or by an application using SETMOUSESPEED.
  1844.             ''' </summary>
  1845.             GetMouseSpeed = &H70
  1846.  
  1847.             ''' <summary>
  1848.             ''' Sets the current mouse speed.
  1849.             ''' The <paramref name="pvParam"/> parameter is an <see cref="Integer"/> variable between 1 (slowest) and 20 (fastest).
  1850.             ''' A value of 10 is the default.
  1851.             ''' This value is typically set using the mouse control panel application.
  1852.             ''' </summary>
  1853.             SetMouseSpeed = &H71
  1854.  
  1855.             ''' <summary>
  1856.             ''' Determines whether active window tracking (activating the window the mouse is on) is on or off.
  1857.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> for on,
  1858.             ''' or <c>False</c> for off.
  1859.             ''' </summary>
  1860.             GetActiveWindowTracking = &H1000
  1861.  
  1862.             ''' <summary>
  1863.             ''' Sets active window tracking (activating the window the mouse is on) either on or off.
  1864.             ''' Set <paramref name="pvParam"/> to <c>True</c> for on or <c>False</c> for off.
  1865.             ''' </summary>
  1866.             SetActiveWindowTracking = &H1001
  1867.  
  1868.             ''' <summary>
  1869.             ''' Determines whether the menu animation feature is enabled.
  1870.             ''' This master switch must be on to enable menu animation effects.
  1871.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if animation is enabled
  1872.             ''' and <c>False</c> if it is disabled.
  1873.             ''' If animation is enabled, GETMENUFADE indicates whether menus use fade or slide animation.
  1874.             ''' </summary>
  1875.             GetMenuAnimation = &H1002
  1876.  
  1877.             ''' <summary>
  1878.             ''' Enables or disables menu animation.
  1879.             ''' This master switch must be on for any menu animation to occur.
  1880.             ''' The <paramref name="pvParam"/> parameter is a <see cref="Boolean"/> variable;
  1881.             ''' set <paramref name="pvParam"/> to <c>True</c> to enable animation and <c>False</c> to disable animation.
  1882.             ''' If animation is enabled, GETMENUFADE indicates whether menus use fade or slide animation.
  1883.             ''' </summary>
  1884.             SetMenuAnimation = &H1003
  1885.  
  1886.             ''' <summary>
  1887.             ''' Determines whether the slide-open effect for combo boxes is enabled.
  1888.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> for enabled,
  1889.             ''' or <c>False</c> for disabled.
  1890.             ''' </summary>
  1891.             GetComboboxAnimation = &H1004
  1892.  
  1893.             ''' <summary>
  1894.             ''' Enables or disables the slide-open effect for combo boxes.
  1895.             ''' Set the <paramref name="pvParam"/> parameter to <c>True</c> to enable the gradient effect, or <c>False</c> to disable it.
  1896.             ''' </summary>
  1897.             SetComboboxAnimation = &H1005
  1898.  
  1899.             ''' <summary>
  1900.             ''' Determines whether the smooth-scrolling effect for list boxes is enabled.
  1901.             ''' The <paramref name="pvParam"/> parameter must point toa <see cref="Boolean"/> variable that receives <c>True</c> for enabled,
  1902.             ''' or <c>False</c> for disabled.
  1903.             ''' </summary>
  1904.             GetListboxSmoothScrolling = &H1006
  1905.  
  1906.             ''' <summary>
  1907.             ''' Enables or disables the smooth-scrolling effect for list boxes.
  1908.             ''' Set the <paramref name="pvParam"/> parameter to <c>True</c> to enable the smooth-scrolling effect,
  1909.             ''' or <c>False</c> to disable it.
  1910.             ''' </summary>
  1911.             SetListboxSmoothScrolling = &H1007
  1912.  
  1913.             ''' <summary>
  1914.             ''' Determines whether the gradient effect for window title bars is enabled.
  1915.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> for enabled,
  1916.             ''' or <c>False</c> for disabled.
  1917.             ''' For more information about the gradient effect, see the GetSysColor function.
  1918.             ''' </summary>
  1919.             GetGradientCaptions = &H1008
  1920.  
  1921.             ''' <summary>
  1922.             ''' Enables or disables the gradient effect for window title bars.
  1923.             ''' Set the <paramref name="pvParam"/> parameter to <c>True</c> to enable it, or <c>False</c> to disable it.
  1924.             ''' The gradient effect is possible only if the system has a color depth of more than 256 colors. For more information about
  1925.             ''' the gradient effect, see the GetSysColor function.
  1926.             ''' </summary>
  1927.             SetGradientCaptions = &H1009
  1928.  
  1929.             ''' <summary>
  1930.             ''' Determines whether menu access keys are always underlined.
  1931.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that
  1932.             ''' receives <c>True</c> if menu access keys are always underlined,
  1933.             ''' and <c>False</c> if they are underlined only when the menu is activated by the keyboard.
  1934.             ''' </summary>
  1935.             GetKeyboardCues = &H100A
  1936.  
  1937.             ''' <summary>
  1938.             ''' Sets the underlining of menu access key letters.
  1939.             ''' The <paramref name="pvParam"/> parameter is a <see cref="Boolean"/> variable.
  1940.             ''' Set <paramref name="pvParam"/> to <c>True</c> to always underline menu access keys,
  1941.             ''' or <c>False</c> to underline menu access keys only when the menu is activated from the keyboard.
  1942.             ''' </summary>
  1943.             SetKeyboardCues = &H100B
  1944.  
  1945.             ''' <summary>
  1946.             ''' Determines whether hot tracking of user-interface elements, such as menu names on menu bars, is enabled.
  1947.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> for enabled,
  1948.             ''' or <c>False</c> for disabled.
  1949.             ''' Hot tracking means that when the cursor moves over an item, it is highlighted but not selected.
  1950.             ''' You can query this value to decide whether to use hot tracking in the user interface of your application.
  1951.             ''' </summary>
  1952.             GetHotTracking = &H100E
  1953.  
  1954.             ''' <summary>
  1955.             ''' Enables or disables hot tracking of user-interface elements such as menu names on menu bars.
  1956.             ''' Set the <paramref name="pvParam"/> parameter to <c>True</c> to enable it, or <c>False</c> to disable it.
  1957.             ''' Hot-tracking means that when the cursor moves over an item, it is highlighted but not selected.
  1958.             ''' </summary>
  1959.             SetHotTracking = &H100F
  1960.  
  1961.             ''' <summary>
  1962.             ''' Determines whether menu fade animation is enabled.
  1963.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c>
  1964.             ''' when fade animation is enabled and <c>False</c> when it is disabled.
  1965.             ''' If fade animation is disabled, menus use slide animation.
  1966.             ''' This flag is ignored unless menu animation is enabled, which you can do using the SETMENUANIMATION flag.
  1967.             ''' For more information, see AnimateWindow.
  1968.             ''' </summary>
  1969.             GetMenuFade = &H1012
  1970.  
  1971.             ''' <summary>
  1972.             ''' Enables or disables menu fade animation.
  1973.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable the menu fade effect or <c>False</c> to disable it.
  1974.             ''' If fade animation is disabled, menus use slide animation.
  1975.             ''' The menu fade effect is possible only if the system has a color depth of more than 256 colors.
  1976.             ''' This flag is ignored unless MENUANIMATION is also set.
  1977.             ''' For more information, see AnimateWindow.
  1978.             ''' </summary>
  1979.             SetMenuFade = &H1013
  1980.  
  1981.             ''' <summary>
  1982.             ''' Determines whether the selection fade effect is enabled.
  1983.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled
  1984.             ''' or <c>False</c> if disabled.
  1985.             ''' The selection fade effect causes the menu item selected by the user to remain on the screen briefly while fading out
  1986.             ''' after the menu is dismissed.
  1987.             ''' </summary>
  1988.             GetSelectionFade = &H1014
  1989.  
  1990.             ''' <summary>
  1991.             ''' The selection fade effect causes the menu item selected by the user to remain on the screen briefly while fading out
  1992.             ''' after the menu is dismissed.
  1993.             ''' The selection fade effect is possible only if the system has a color depth of more than 256 colors.
  1994.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable the selection fade effect or <c>False</c> to disable it.
  1995.             ''' </summary>
  1996.             SetSelectionFade = &H1015
  1997.  
  1998.             ''' <summary>
  1999.             ''' Determines whether ToolTip animation is enabled.
  2000.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled
  2001.             ''' or <c>False</c> if disabled.
  2002.             ''' If ToolTip animation is enabled, GETTOOLTIPFADE indicates whether ToolTips use fade or slide animation.
  2003.             ''' </summary>
  2004.             GetTooltipAnimation = &H1016
  2005.  
  2006.             ''' <summary>
  2007.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable ToolTip animation or <c>False</c> to disable it.
  2008.             ''' If enabled, you can use SETTOOLTIPFADE to specify fade or slide animation.
  2009.             ''' </summary>
  2010.             SetTooltipAnimation = &H1017
  2011.  
  2012.             ''' <summary>
  2013.             ''' Determines whether the cursor has a shadow around it.
  2014.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the shadow is enabled,
  2015.             ''' <c>False</c> if it is disabled.
  2016.             ''' This effect appears only if the system has a color depth of more than 256 colors.
  2017.             ''' </summary>
  2018.             GetCursorShadow = &H101A
  2019.  
  2020.             ''' <summary>
  2021.             ''' Enables or disables a shadow around the cursor.
  2022.             ''' The <paramref name="pvParam"/> parameter is a <see cref="Boolean"/> variable.
  2023.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable the shadow or <c>False</c> to disable the shadow.
  2024.             ''' This effect appears only if the system has a color depth of more than 256 colors.
  2025.             ''' </summary>
  2026.             SetCursorShadow = &H101B
  2027.  
  2028.             ''' <summary>
  2029.             ''' Retrieves the state of the Mouse Sonar feature.
  2030.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled or
  2031.             ''' <c>False</c> otherwise.
  2032.             ''' For more information, see About Mouse Input on MSDN.
  2033.             ''' </summary>
  2034.             GetMouseSonar = &H101C
  2035.  
  2036.             ''' <summary>
  2037.             ''' Turns the Sonar accessibility feature on or off.
  2038.             ''' This feature briefly shows several concentric circles around the mouse pointer when the user presses and releases the CTRL key.
  2039.             ''' The <paramref name="pvParam"/> parameter specifies <c>True</c> for on and <c>False</c> for off.
  2040.             ''' The default is off.
  2041.             ''' For more information, see About Mouse Input.
  2042.             ''' </summary>
  2043.             SetMouseSonar = &H101D
  2044.  
  2045.             ''' <summary>
  2046.             ''' Retrieves the state of the Mouse ClickLock feature.
  2047.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled,
  2048.             ''' or <c>False</c> otherwise.
  2049.             ''' For more information, see About Mouse Input.
  2050.             ''' </summary>
  2051.             GetMouseClickLock = &H101E
  2052.  
  2053.             ''' <summary>
  2054.             ''' Turns the Mouse ClickLock accessibility feature on or off.
  2055.             ''' This feature temporarily locks down the primary mouse button when that button is clicked and
  2056.             ''' held down for the time specified by SETMOUSECLICKLOCKTIME.
  2057.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> for on, or <c>False</c> for off. The default is off.
  2058.             ''' For more information, see Remarks and About Mouse Input on MSDN.
  2059.             ''' </summary>
  2060.             SetMouseClickLock = &H101F
  2061.  
  2062.             ''' <summary>
  2063.             ''' Retrieves the state of the Mouse Vanish feature.
  2064.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled or
  2065.             ''' <c>False</c> otherwise.
  2066.             ''' For more information, see About Mouse Input on MSDN.
  2067.             ''' </summary>
  2068.             GetMouseVanish = &H1020
  2069.  
  2070.             ''' <summary>
  2071.             ''' Turns the Vanish feature on or off.
  2072.             ''' This feature hides the mouse pointer when the user types; the pointer reappears when the user moves the mouse.
  2073.             ''' The <paramref name="pvParam"/> parameter specifies <c>True</c> for on and <c>False</c> for off. The default is off.
  2074.             ''' For more information, see About Mouse Input on MSDN.
  2075.             ''' </summary>
  2076.             SetMouseVanish = &H1021
  2077.  
  2078.             ''' <summary>
  2079.             ''' Determines whether native User menus have flat menu appearance.
  2080.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that returns <c>True</c> if the
  2081.             ''' flat menu appearance is set, or <c>False</c> otherwise.
  2082.             ''' </summary>
  2083.             GetFlatMenu = &H1022
  2084.  
  2085.             ''' <summary>
  2086.             ''' Enables or disables flat menu appearance for native User menus.
  2087.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable flat menu appearance or <c>False</c> to disable it.
  2088.             ''' When enabled, the menu bar uses COLOR_MENUBAR for the menubar background, COLOR_MENU for the menu-popup background, COLOR_MENUHILIGHT
  2089.             ''' for the fill of the current menu selection, and COLOR_HILIGHT for the outline of the current menu selection.
  2090.             ''' If disabled, menus are drawn using the same metrics and colors as in Windows 2000 and earlier.
  2091.             ''' </summary>
  2092.             SetFlatMenu = &H1023
  2093.  
  2094.             ''' <summary>
  2095.             ''' Determines whether the drop shadow effect is enabled.
  2096.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that returns <c>True</c> if enabled or
  2097.             ''' <c>False</c> if disabled.
  2098.             ''' </summary>
  2099.             GetDropShadow = &H1024
  2100.  
  2101.             ''' <summary>
  2102.             ''' Enables or disables the drop shadow effect.
  2103.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable the drop shadow effect or <c>False</c> to disable it.
  2104.             ''' You must also have CS_DROPSHADOW in the window class style.
  2105.             ''' </summary>
  2106.             SetDropShadow = &H1025
  2107.  
  2108.             ''' <summary>
  2109.             ''' Retrieves a <see cref="Boolean"/> indicating whether an application can reset the screensaver's timer by calling the SendInput function
  2110.             ''' to simulate keyboard or mouse input.
  2111.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c>
  2112.             ''' if the simulated input will be blocked, or <c>False</c> otherwise.
  2113.             ''' </summary>
  2114.             GetBlockSendInputResets = &H1026
  2115.  
  2116.             ''' <summary>
  2117.             ''' Determines whether an application can reset the screensaver's timer by calling the SendInput function to simulate keyboard
  2118.             ''' or mouse input.
  2119.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> if the screensaver will not be deactivated by simulated input,
  2120.             ''' or <c>False</c> if the screensaver will be deactivated by simulated input.
  2121.             ''' </summary>
  2122.             SetBlockSendInputResets = &H1027
  2123.  
  2124.             ''' <summary>
  2125.             ''' Determines whether UI effects are enabled or disabled.
  2126.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c>
  2127.             ''' if all UI effects are enabled, or <c>False</c> if they are disabled.
  2128.             ''' </summary>
  2129.             GetUiEffects = &H103E
  2130.  
  2131.             ''' <summary>
  2132.             ''' Enables or disables UI effects.
  2133.             ''' Set the <paramref name="pvParam"/> parameter to <c>True</c> to enable all UI effects or <c>False</c> to disable all UI effects.
  2134.             ''' </summary>
  2135.             SetUiEffects = &H103F
  2136.  
  2137.             ''' <summary>
  2138.             ''' Retrieves the amount of time following user input, in milliseconds, during which the system will not allow applications
  2139.             ''' to force themselves into the foreground.
  2140.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UShort"/> variable that receives the time.
  2141.             ''' </summary>
  2142.             GetForegroundLockTimeout = &H2000
  2143.  
  2144.             ''' <summary>
  2145.             ''' Sets the amount of time following user input, in milliseconds, during which the system does not allow applications
  2146.             ''' to force themselves into the foreground.
  2147.             ''' Set <paramref name="pvParam"/> to the new timeout value.
  2148.             ''' The calling thread must be able to change the foreground window, otherwise the call fails.
  2149.             ''' </summary>
  2150.             SetForegroundLockTimeout = &H2001
  2151.  
  2152.             ''' <summary>
  2153.             ''' Retrieves the active window tracking delay, in milliseconds.
  2154.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UShort"/> variable that receives the time.
  2155.             ''' </summary>
  2156.             GetActiveWndTrkTimeout = &H2002
  2157.  
  2158.             ''' <summary>
  2159.             ''' Sets the active window tracking delay.
  2160.             ''' Set <paramref name="pvParam"/> to the number of milliseconds to delay before activating the window under the mouse pointer.
  2161.             ''' </summary>
  2162.             SetActiveWndTrkTimeout = &H2003
  2163.  
  2164.             ''' <summary>
  2165.             ''' Retrieves the number of times SetForegroundWindow will flash the taskbar button when rejecting a foreground switch request.
  2166.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UShort"/> variable that receives the value.
  2167.             ''' </summary>
  2168.             GetForegroundFlashCount = &H2004
  2169.  
  2170.             ''' <summary>
  2171.             ''' Sets the number of times SetForegroundWindow will flash the taskbar button when rejecting a foreground switch request.
  2172.             ''' Set <paramref name="pvParam"/> to the number of times to flash.
  2173.             ''' </summary>
  2174.             SetForegroundFlashCount = &H2005
  2175.  
  2176.             ''' <summary>
  2177.             ''' Retrieves the caret width in edit controls, in pixels.
  2178.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UShort"/> that receives this value.
  2179.             ''' </summary>
  2180.             GetCaretWidth = &H2006
  2181.  
  2182.             ''' <summary>
  2183.             ''' Sets the caret width in edit controls.
  2184.             ''' Set <paramref name="pvParam"/> to the desired width, in pixels.
  2185.             ''' The default and minimum value is 1.
  2186.             ''' </summary>
  2187.             SetCaretWidth = &H2007
  2188.  
  2189.             ''' <summary>
  2190.             ''' Retrieves the time delay before the primary mouse button is locked.
  2191.             ''' The <paramref name="pvParam"/> parameter must point to <see cref="Integer"/> that receives the time delay.
  2192.             ''' This is only enabled if SETMOUSECLICKLOCK is set to <c>True</c>.
  2193.             ''' For more information, see About Mouse Input on MSDN.
  2194.             ''' </summary>
  2195.             GetMouseClickLockTime = &H2008
  2196.  
  2197.             ''' <summary>
  2198.             ''' Turns the Mouse ClickLock accessibility feature on or off.
  2199.             ''' This feature temporarily locks down the primary mouse button when that button is clicked and
  2200.             ''' held down for the time specified by SETMOUSECLICKLOCKTIME.
  2201.             ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> for on, or <c>False</c> for off.
  2202.             ''' The default is off.
  2203.             ''' For more information, see Remarks and About Mouse Input on MSDN.
  2204.             ''' </summary>
  2205.             SetMouseClickLockTime = &H2009
  2206.  
  2207.             ''' <summary>
  2208.             ''' Retrieves a contrast value that is used in ClearType™ smoothing.
  2209.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UInteger"/> that receives the information.
  2210.             ''' </summary>
  2211.             GetFontSmoothingContrast = &H200C
  2212.  
  2213.             ''' <summary>
  2214.             ''' Sets the contrast value used in ClearType smoothing.
  2215.             ''' The <paramref name="pvParam"/> parameter points to a <see cref="UInteger"/> that holds the contrast value.
  2216.             ''' Valid contrast values are from 1000 to 2200. The default value is 1400.
  2217.             ''' When using this option, the fWinIni parameter must be set to SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE; otherwise,
  2218.             ''' SystemParametersInfo fails.
  2219.             ''' SETFONTSMOOTHINGTYPE must also be set to FE_FONTSMOOTHINGCLEARTYPE.
  2220.             ''' </summary>
  2221.             SetFontSmoothingContrast = &H200D
  2222.  
  2223.             ''' <summary>
  2224.             ''' Retrieves the width, in pixels, of the left and right edges of the focus rectangle drawn with DrawFocusRect.
  2225.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UInteger"/>.
  2226.             ''' </summary>
  2227.             GetFocusBorderWidth = &H200E
  2228.  
  2229.             ''' <summary>
  2230.             ''' Sets the height of the left and right edges of the focus rectangle drawn with DrawFocusRect to the value of
  2231.             ''' the <paramref name="pvParam"/> parameter.
  2232.             ''' </summary>
  2233.             SetFocusBorderWidth = &H200F
  2234.  
  2235.             ''' <summary>
  2236.             ''' Retrieves the height, in pixels, of the top and bottom edges of the focus rectangle drawn with DrawFocusRect.
  2237.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UInteger"/>.
  2238.             ''' </summary>
  2239.             GetFocusBorderHeight = &H2010
  2240.  
  2241.             ''' <summary>
  2242.             ''' Sets the height of the top and bottom edges of the focus rectangle drawn with DrawFocusRect to the
  2243.             ''' value of the <paramref name="pvParam"/> parameter.
  2244.             ''' </summary>
  2245.             SetFocusBorderHeight = &H2011
  2246.  
  2247.             ''' <summary>
  2248.             ''' Determines whether animations are enabled or disabled.
  2249.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if animations are enabled,
  2250.             ''' or <c>False</c> otherwise.
  2251.             ''' </summary>
  2252.             GetClientAreaAnimation = &H1042
  2253.  
  2254.             ''' <summary>
  2255.             ''' Turns client area animations on or off.
  2256.             ''' The <paramref name="pvParam"/> parameter is a <see cref="Boolean"/> variable.
  2257.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable animations and other transient effects in the client area,
  2258.             ''' or <c>False</c> to disable them..
  2259.             ''' </summary>
  2260.             SetClientAreaAnimation = &H1043
  2261.  
  2262.             ''' <summary>
  2263.             ''' Determines whether overlapped content is enabled or disabled.
  2264.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled,
  2265.             ''' or <c>False</c> otherwise.
  2266.             ''' </summary>
  2267.             GetDisableOverlappedContent = &H1040
  2268.  
  2269.             ''' <summary>
  2270.             ''' Turns overlapped content (such as background images and watermarks) on or off.
  2271.             ''' The <paramref name="pvParam"/> parameter is a <see cref="Boolean"/> variable.
  2272.             ''' Set <paramref name="pvParam"/> to <c>True</c> to disable overlapped content, or <c>False</c> to enable overlapped content.
  2273.             ''' </summary>
  2274.             SetDisableOverlappedContent = &H1041
  2275.  
  2276.             ''' <summary>
  2277.             ''' Retrieves the time that notification pop-ups should be displayed, in seconds.
  2278.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="ULong"/> that receives the message duration.
  2279.             ''' </summary>
  2280.             GetMessageDuration = &H2016
  2281.  
  2282.             ''' <summary>
  2283.             ''' Sets the time that notification pop-ups should be displayed, in seconds.
  2284.             ''' The <paramref name="pvParam"/> parameter specifies the message duration.
  2285.             ''' </summary>
  2286.             SetMessageDuration = &H2017
  2287.  
  2288.             ''' <summary>
  2289.             ''' Determines whether ClearType is enabled.
  2290.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if ClearType is enabled, or <c>False</c> otherwise.
  2291.             ''' </summary>
  2292.             GetCleartype = &H1048
  2293.  
  2294.             ''' <summary>
  2295.             ''' Turns ClearType on or off.
  2296.             ''' The <paramref name="pvParam"/> parameter is a <see cref="Boolean"/> variable.
  2297.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable ClearType, or <c>False</c> to disable it.
  2298.             ''' </summary>
  2299.             SetCleartype = &H1049
  2300.  
  2301.             ''' <summary>
  2302.             ''' Starting with Windows 8: Determines whether the system language bar is enabled or disabled.
  2303.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the language bar is enabled, or <c>False</c> otherwise.
  2304.             ''' </summary>
  2305.             GetSystemlanguageBar = &H1050
  2306.  
  2307.             ''' <summary>
  2308.             ''' Starting with Windows 8: Turns the legacy language bar feature on or off.
  2309.             ''' The <paramref name="pvParam"/> parameter is a pointer to a <see cref="Boolean"/> variable.
  2310.             ''' Set <paramref name="pvParam"/> to <c>True</c> to enable the legacy language bar, or <c>False</c> to disable it.
  2311.             ''' The flag is supported on Windows 8 where the legacy language bar is replaced by Input Switcher and therefore turned off by default.
  2312.             ''' Turning the legacy language bar on is provided for compatibility reasons and has no effect on the Input Switcher.
  2313.             ''' </summary>
  2314.             SetSystemlanguageBar = &H1051
  2315.  
  2316.             ''' <summary>
  2317.             ''' Retrieves the number of characters to scroll when the horizontal mouse wheel is moved.
  2318.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UInteger"/> variable that receives the number of lines.
  2319.             ''' The default value is 3.
  2320.             ''' </summary>
  2321.             GetWheelscrollChars = &H6C
  2322.  
  2323.             ''' <summary>
  2324.             ''' Sets the number of characters to scroll when the horizontal mouse wheel is moved.
  2325.             ''' The number of characters is set from the <paramref name="uiParam"/> parameter.
  2326.             ''' </summary>
  2327.             SetWheelscrollChars = &H6D
  2328.  
  2329.             ''' <summary>
  2330.             ''' Determines whether the screen saver requires a password to display the Windows desktop.
  2331.             ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the screen saver requires a password, or <c>False</c> otherwise.
  2332.             ''' The <paramref name="uiParam"/> parameter is ignored.
  2333.             ''' </summary>
  2334.             GetScreensaveSecure = &H76
  2335.  
  2336.             ''' <summary>
  2337.             ''' Sets whether the screen saver requires the user to enter a password to display the Windows desktop.
  2338.             ''' The <paramref name="uiParam"/> parameter is a <see cref="Boolean"/> variable.
  2339.             ''' The <paramref name="pvParam"/> parameter is ignored.
  2340.             ''' Set <paramref name="uiParam"/> to <c>True</c> to require a password, or <c>False</c> to not require a password.
  2341.             ''' If the machine has entered power saving mode or system lock state, an ERROR_OPERATION_IN_PROGRESS exception occurs.
  2342.             ''' </summary>
  2343.             SetScreensaveSecure = &H77
  2344.  
  2345.             ''' <summary>
  2346.             ''' Retrieves the number of milliseconds that a thread can go without dispatching a message before the system considers it unresponsive.
  2347.             ''' The <paramref name="pvParam"/> parameter must point to an integer variable that receives the value.
  2348.             ''' </summary>
  2349.             GetHungAppTimeout = &H78
  2350.  
  2351.             ''' <summary>
  2352.             ''' Sets the hung application time-out to the value of the <paramref name="uiParam"/> parameter.
  2353.             ''' This value is the number of milliseconds that a thread can go without dispatching a message before the system considers it unresponsive
  2354.             ''' </summary>
  2355.             SetHungAppTimeout = &H79
  2356.  
  2357.             ''' <summary>
  2358.             ''' Retrieves the number of milliseconds that the system waits before terminating an application that does not respond to a shutdown request.
  2359.             ''' The <paramref name="pvParam"/> parameter must point to an integer variable that receives the value.
  2360.             ''' </summary>
  2361.             GetWaitToKillTimeout = &H7A
  2362.  
  2363.             ''' <summary>
  2364.             ''' Sets the application shutdown request time-out to the value of the <paramref name="uiParam"/> parameter.
  2365.             ''' This value is the number of milliseconds that the system waits before terminating an application that does not respond to a shutdown request
  2366.             ''' </summary>
  2367.             SetWaitToKillTimeout = &H7B
  2368.  
  2369.             ''' <summary>
  2370.             ''' Retrieves the number of milliseconds that the service control manager waits before
  2371.             ''' terminating a service that does not respond to a shutdown request.
  2372.             ''' The <paramref name="pvParam"/> parameter must point to an integer variable that receives the value.
  2373.             ''' </summary>
  2374.             GetWaitToKillServiceTimeout = &H7C
  2375.  
  2376.             ''' <summary>
  2377.             ''' Sets the service shutdown request time-out to the value of the <paramref name="uiParam"/> parameter.
  2378.             ''' This value is the number of milliseconds that the system waits before terminating a service that does not respond to a shutdown request
  2379.             ''' </summary>
  2380.             SetWaitToKillServiceTimeout = &H7D
  2381.  
  2382.             ' ''' <summary>
  2383.             ' ''' Windows Me/98/95: Pen windows is being loaded or unloaded.
  2384.             ' ''' The <paramref name="uiParam"/> parameter is <c>True</c> when loading and <c>False</c> when unloading pen windows.
  2385.             ' ''' The <paramref name="pvParam"/> parameter is null.
  2386.             ' ''' </summary>
  2387.             ' SetPenWindows = &H31
  2388.  
  2389.             ' ''' <summary>
  2390.             ' ''' Determines whether a screen saver is currently running on the window station of the calling process.
  2391.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if a screen saver is currently running,
  2392.             ' ''' or <c>False</c> otherwise.
  2393.             ' ''' Note that only the interactive window station, "WinSta0", can have a screen saver running.
  2394.             ' ''' </summary>
  2395.             ' GetScreensaverRunning = &H72
  2396.  
  2397.             ' ''' <summary>
  2398.             ' ''' Windows Me/98:  Used internally; applications should not use this flag.
  2399.             ' ''' </summary>
  2400.             ' SetScreensaverRunning = &H61
  2401.  
  2402.             ' ''' <summary>
  2403.             ' ''' Retrieves information about the FilterKeys accessibility feature.
  2404.             ' ''' The <paramref name="pvParam"/> parameter must point to a FILTERKEYS structure that receives the information.
  2405.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(FILTERKEYS).
  2406.             ' ''' </summary>
  2407.             ' GetFilterKeys = &H32
  2408.  
  2409.             ' ''' <summary>
  2410.             ' ''' Sets the parameters of the FilterKeys accessibility feature.
  2411.             ' ''' The <paramref name="pvParam"/> parameter must point to a FILTERKEYS structure that contains the new parameters.
  2412.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(FILTERKEYS).
  2413.             ' ''' </summary>
  2414.             ' SetFilterKeys = &H33
  2415.  
  2416.             ' ''' <summary>
  2417.             ' ''' Retrieves information about the ToggleKeys accessibility feature.
  2418.             ' ''' The <paramref name="pvParam"/> parameter must point to a TOGGLEKEYS structure that receives the information.
  2419.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(TOGGLEKEYS).
  2420.             ' ''' </summary>
  2421.             ' GetToggleKeys = &H34
  2422.  
  2423.             ' ''' <summary>
  2424.             ' ''' Sets the parameters of the ToggleKeys accessibility feature.
  2425.             ' ''' The <paramref name="pvParam"/> parameter must point to a TOGGLEKEYS structure that contains the new parameters.
  2426.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(TOGGLEKEYS).
  2427.             ' ''' </summary>
  2428.             ' SetToggleKeys = &H35
  2429.  
  2430.             ' ''' <summary>
  2431.             ' ''' Retrieves information about the MouseKeys accessibility feature.
  2432.             ' ''' The <paramref name="pvParam"/> parameter must point to a MOUSEKEYS structure that receives the information.
  2433.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(MOUSEKEYS).
  2434.             ' ''' </summary>
  2435.             ' GetMouseKeys = &H36
  2436.  
  2437.             ' ''' <summary>
  2438.             ' ''' Sets the parameters of the MouseKeys accessibility feature.
  2439.             ' ''' The <paramref name="pvParam"/> parameter must point to a MOUSEKEYS structure that contains the new parameters.
  2440.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(MOUSEKEYS).
  2441.             ' ''' </summary>
  2442.             ' SetMouseKeys = &H37
  2443.  
  2444.             ' ''' <summary>
  2445.             ' ''' Determines whether the Show Sounds accessibility flag is on or off.
  2446.             ' ''' If it is on, the user requires an application to present information visually in situations where
  2447.             ' ''' it would otherwise present the information only in audible form.
  2448.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the feature is on,
  2449.             ' ''' or <c>False</c> if it is off.
  2450.             ' ''' Using this value is equivalent to calling GetSystemMetrics (SM_SHOWSOUNDS). That is the recommended call.
  2451.             ' ''' </summary>
  2452.             ' GetShowSounds = &H38
  2453.  
  2454.             ' ''' <summary>
  2455.             ' ''' Sets the parameters of the SoundSentry accessibility feature.
  2456.             ' ''' The <paramref name="pvParam"/> parameter must point to a SOUNDSENTRY structure that contains the new parameters.
  2457.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(SOUNDSENTRY).
  2458.             ' ''' </summary>
  2459.             ' SetShowSounds = &H39
  2460.  
  2461.             ' ''' <summary>
  2462.             ' ''' Retrieves information about the StickyKeys accessibility feature.
  2463.             ' ''' The <paramref name="pvParam"/> parameter must point to a STICKYKEYS structure that receives the information.
  2464.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(STICKYKEYS).
  2465.             ' ''' </summary>
  2466.             ' GetStickyKeys = &H3A
  2467.  
  2468.             ' ''' <summary>
  2469.             ' ''' Sets the parameters of the StickyKeys accessibility feature.
  2470.             ' ''' The <paramref name="pvParam"/> parameter must point to a STICKYKEYS structure that contains the new parameters.
  2471.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(STICKYKEYS).
  2472.             ' ''' </summary>
  2473.             ' SetStickyKeys = &H3B
  2474.  
  2475.             ' ''' <summary>
  2476.             ' ''' Retrieves information about the time-out period associated with the accessibility features.
  2477.             ' ''' The <paramref name="pvParam"/> parameter must point to an ACCESSTIMEOUT structure that receives the information.
  2478.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(ACCESSTIMEOUT).
  2479.             ' ''' </summary>
  2480.             ' GetAccessTimeout = &H3C
  2481.  
  2482.             ' ''' <summary>
  2483.             ' ''' Sets the time-out period associated with the accessibility features.
  2484.             ' ''' The <paramref name="pvParam"/> parameter must point to an ACCESSTIMEOUT structure that contains the new parameters.
  2485.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(ACCESSTIMEOUT).
  2486.             ' ''' </summary>
  2487.             ' SetAccessTimeout = &H3D
  2488.  
  2489.             ' ''' <summary>
  2490.             ' ''' Windows Me/98/95:  Retrieves information about the SerialKeys accessibility feature.
  2491.             ' ''' The <paramref name="pvParam"/> parameter must point to a SERIALKEYS structure that receives the information.
  2492.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(SERIALKEYS).
  2493.             ' ''' </summary>
  2494.             ' GetSerialKeys = &H3E
  2495.  
  2496.             ' ''' <summary>
  2497.             ' ''' Windows Me/98/95:  Sets the parameters of the SerialKeys accessibility feature.
  2498.             ' ''' The <paramref name="pvParam"/> parameter must point to a SERIALKEYS structure that contains the new parameters.
  2499.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(SERIALKEYS).
  2500.             ' ''' </summary>
  2501.             ' SetSerialKeys = &H3F
  2502.  
  2503.             ' ''' <summary>
  2504.             ' ''' Retrieves information about the SoundSentry accessibility feature.
  2505.             ' ''' The <paramref name="pvParam"/> parameter must point to a SOUNDSENTRY structure that receives the information.
  2506.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(SOUNDSENTRY).
  2507.             ' ''' </summary>
  2508.             ' GetSoundsEntry = &H40
  2509.  
  2510.             ' ''' <summary>
  2511.             ' ''' Sets the parameters of the SoundSentry accessibility feature.
  2512.             ' ''' The <paramref name="pvParam"/> parameter must point to a SOUNDSENTRY structure that contains the new parameters.
  2513.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(SOUNDSENTRY).
  2514.             ' ''' </summary>
  2515.             ' SetSoundsEntry = &H41
  2516.  
  2517.             ' ''' <summary>
  2518.             ' ''' Determines whether audio descriptions are enabled or disabled.
  2519.             ' ''' The <paramref name="pvParam"/> parameter is a pointer to an AUDIODESCRIPTION structure.
  2520.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(AUDIODESCRIPTION).
  2521.             ' ''' </summary>
  2522.             ' GetAudioDescription = &H74
  2523.  
  2524.             ' ''' <summary>
  2525.             ' ''' Turns the audio descriptions feature on or off.
  2526.             ' ''' The pvParam parameter is a pointer to an AUDIODESCRIPTION structure.
  2527.             ' ''' </summary>
  2528.             ' SetAudioDescription = &H75
  2529.  
  2530.             ' ''' <summary>
  2531.             ' ''' Not implemented.
  2532.             ' ''' </summary>
  2533.             ' GetFontSmoothingOrientation = &H2012
  2534.  
  2535.             ' ''' <summary>
  2536.             ' ''' Not implemented.
  2537.             ' ''' </summary>
  2538.             ' SetFontSmoothingOrientation = &H2013
  2539.  
  2540.             ' ''' <summary>
  2541.             ' ''' Retrieves the type of font smoothing.
  2542.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="UInteger"/> that receives the information.
  2543.             ' ''' </summary>
  2544.             ' GetFontSmoothingType = &H200A
  2545.  
  2546.             ' ''' <summary>
  2547.             ' ''' Sets the font smoothing type.
  2548.             ' ''' The <paramref name="pvParam"/> parameter points to a UINT that contains either FE_FONTSMOOTHINGSTANDARD,
  2549.             ' ''' if standard anti-aliasing is used, or FE_FONTSMOOTHINGCLEARTYPE, if ClearType is used. The default is FE_FONTSMOOTHINGSTANDARD.
  2550.             ' ''' When using this option, the fWinIni parameter must be set to SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE; otherwise,
  2551.             ' ''' SystemParametersInfo fails.
  2552.             ' ''' </summary>
  2553.             ' SetFontSmoothingType = &H200B
  2554.  
  2555.             ' ''' <summary>
  2556.             ' ''' If SETTOOLTIPANIMATION is enabled, GETTOOLTIPFADE indicates whether ToolTip animation uses a fade effect or a slide effect.
  2557.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> for fade animation
  2558.             ' ''' or <c>False</c> for slide animation.
  2559.             ' ''' For more information on slide and fade effects, see AnimateWindow.
  2560.             ' ''' </summary>
  2561.             ' GetTooltipFade = &H1018
  2562.  
  2563.             ' ''' <summary>
  2564.             ' ''' If the SETTOOLTIPANIMATION flag is enabled, use SETTOOLTIPFADE to indicate whether ToolTip animation uses a fade effect or a slide effect.
  2565.             ' ''' Set <paramref name="pvParam"/> to <c>True</c> for fade animation or <c>False</c> for slide animation.
  2566.             ' ''' The tooltip fade effect is possible only if the system has a color depth of more than 256 colors.
  2567.             ' ''' For more information on the slide and fade effects, see the AnimateWindow function.
  2568.             ' ''' </summary>
  2569.             ' SetTooltipFade = &H1019
  2570.  
  2571.             ' ''' <summary>
  2572.             ' ''' Same as <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetKeyboardCues"/>.
  2573.             ' ''' </summary>
  2574.             ' GetMenuUnderlines = GETKEYBOARDCUES
  2575.  
  2576.             ' ''' <summary>
  2577.             ' ''' Same as <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetKeyboardCues"/>.
  2578.             ' ''' </summary>
  2579.             ' SetMenuUnderlines = SETKEYBOARDCUES
  2580.  
  2581.             ' ''' <summary>
  2582.             ' ''' Determines whether windows activated through active window tracking will be brought to the top.
  2583.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> for on,
  2584.             ' ''' or <c>False</c> for off.
  2585.             ' ''' </summary>
  2586.             ' GetActiveWndTrkZorder = &H100C
  2587.  
  2588.             ' ''' <summary>
  2589.             ' ''' Determines whether or not windows activated through active window tracking should be brought to the top.
  2590.             ' ''' Set <paramref name="pvParam"/> to <c>True</c> for on or <c>False</c> for off.
  2591.             ' ''' </summary>
  2592.             ' SetActiveWndTrkZorder = &H100D
  2593.  
  2594.             ' ''' <summary>
  2595.             ' ''' Determines whether the IME status window is visible (on a per-user basis).
  2596.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable  that
  2597.             ' ''' receives <c>True</c> if the status window is visible, or <c>False</c> if it is not.
  2598.             ' ''' </summary>
  2599.             ' GetShowIMEui = &H6E
  2600.  
  2601.             ' ''' <summary>
  2602.             ' ''' Sets whether the IME status window is visible or not on a per-user basis.
  2603.             ' ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> for on or <c>False</c> for off.
  2604.             ' ''' </summary>
  2605.             ' SetShowIMEui = &H6F
  2606.  
  2607.             ' ''' <summary>
  2608.             ' ''' Windows 95:  Determines whether the Windows extension, Windows Plus!, is installed.
  2609.             ' ''' Set the <paramref name="uiParam"/> parameter to 1.
  2610.             ' ''' The <paramref name="pvParam"/> parameter is not used.
  2611.             ' ''' The function returns <c>True</c> if the extension is installed, or <c>False</c> if it is not.
  2612.             ' ''' </summary>
  2613.             ' GetWindowsExtension = &H5C
  2614.  
  2615.             ' ''' <summary>
  2616.             ' ''' Used internally; applications should not use this value.
  2617.             ' ''' </summary>
  2618.             ' SetHandheld = &H4E
  2619.  
  2620.             ' ''' <summary>
  2621.             ' ''' Retrieves the time-out value for the low-power phase of screen saving.
  2622.             ' ''' The <paramref name="pvParam"/> parameter must point to an <see cref="Integer"/> variable that receives the value.
  2623.             ' ''' This flag is supported for 32-bit applications only.
  2624.             ' ''' </summary>
  2625.             ' GetLowPowerTimeout = &H4F
  2626.  
  2627.             ' ''' <summary>
  2628.             ' ''' Sets the time-out value, in seconds, for the low-power phase of screen saving.
  2629.             ' ''' The <paramref name="uiParam"/> parameter specifies the new value.
  2630.             ' ''' The <paramref name="pvParam"/> parameter must be null.
  2631.             ' ''' This flag is supported for 32-bit applications only.
  2632.             ' ''' </summary>
  2633.             ' SetLowPowerTimeout = &H51
  2634.  
  2635.             ' ''' <summary>
  2636.             ' ''' Retrieves the time-out value for the power-off phase of screen saving. The <paramref name="pvParam"/> parameter must
  2637.             ' ''' point to an <see cref="Integer"/> variable that receives the value.
  2638.             ' ''' This flag is supported for 32-bit applications only.
  2639.             ' ''' </summary>
  2640.             ' GetPowerOffTimeout = &H50
  2641.  
  2642.             ' ''' <summary>
  2643.             ' ''' Sets the time-out value, in seconds, for the power-off phase of screen saving. The <paramref name="uiParam"/> parameter specifies the new value.
  2644.             ' ''' The <paramref name="pvParam"/> parameter must be null.
  2645.             ' ''' This flag is supported for 32-bit applications only.
  2646.             ' ''' </summary>
  2647.             ' SetPowerOffTimeout = &H52
  2648.  
  2649.             ' ''' <summary>
  2650.             ' ''' Determines whether the low-power phase of screen saving is enabled.
  2651.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable
  2652.             ' ''' that receives <c>True</c> if enabled, or <c>False</c> if disabled.
  2653.             ' ''' This flag is supported for 32-bit applications only.
  2654.             ' ''' </summary>
  2655.             ' GetLowPowerActive = &H53
  2656.  
  2657.             ' ''' <summary>
  2658.             ' ''' Activates or deactivates the low-power phase of screen saving.
  2659.             ' ''' Set <paramref name="uiParam"/> to 1 to activate, or zero to deactivate.
  2660.             ' ''' The <paramref name="pvParam"/> parameter must be null.
  2661.             ' ''' This flag is supported for 32-bit applications only.
  2662.             ' ''' </summary>
  2663.             ' SetLowPowerActive = &H55
  2664.  
  2665.             ' ''' <summary>
  2666.             ' ''' Determines whether the power-off phase of screen saving is enabled.
  2667.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable
  2668.             ' ''' that receives <c>True</c> if enabled, or <c>False</c> if disabled.
  2669.             ' ''' This flag is supported for 32-bit applications only.
  2670.             ' ''' </summary>
  2671.             ' GetPowerOffActive = &H54
  2672.  
  2673.             ' ''' <summary>
  2674.             ' ''' Activates or deactivates the power-off phase of screen saving. Set <paramref name="uiParam"/> to 1 to activate, or zero to deactivate.
  2675.             ' ''' The <paramref name="pvParam"/> parameter must be null.
  2676.             ' ''' This flag is supported for 32-bit applications only.
  2677.             ' ''' </summary>
  2678.             ' SetPowerOffActive = &H56
  2679.  
  2680.             ' ''' <summary>
  2681.             ' ''' Retrieves information about the HighContrast accessibility feature.
  2682.             ' ''' The <paramref name="pvParam"/> parameter must point to a HIGHCONTRAST structure that receives the information.
  2683.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(HIGHCONTRAST).
  2684.             ' ''' For a general discussion, see remarks.
  2685.             ' ''' Windows NT:  This value is not supported.
  2686.             ' ''' </summary>
  2687.             ' ''' <remarks>
  2688.             ' ''' There is a difference between the High Contrast color scheme and the High Contrast Mode.
  2689.             ' ''' The High Contrast color scheme changes the system colors to colors that have obvious contrast;
  2690.             ' ''' you switch to this color scheme by using the Display Options in the control panel.
  2691.             ' ''' The High Contrast Mode, which uses GETHIGHCONTRAST and SETHIGHCONTRAST, advises applications to
  2692.             ' ''' modify their appearance for visually-impaired users.
  2693.             ' ''' It involves such things as audible warning to users and customized color scheme
  2694.             ' ''' (using the Accessibility Options in the control panel).
  2695.             ' ''' For more information, see HIGHCONTRAST on MSDN.
  2696.             ' ''' For more information on general accessibility features, see Accessibility on MSDN.
  2697.             ' ''' </remarks>
  2698.             ' GetHighContrast = &H42
  2699.  
  2700.             ' ''' <summary>
  2701.             ' ''' Sets the parameters of the HighContrast accessibility feature.
  2702.             ' ''' The <paramref name="pvParam"/> parameter must point to a HIGHCONTRAST structure that contains the new parameters.
  2703.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(HIGHCONTRAST).
  2704.             ' ''' Windows NT: This value is not supported.
  2705.             ' ''' </summary>
  2706.             ' SetHighContrast = &H43
  2707.  
  2708.             ' ''' <summary>
  2709.             ' ''' Determines whether the user relies on the keyboard instead of the mouse,
  2710.             ' ''' and wants applications to display keyboard interfaces that would otherwise be hidden.
  2711.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if the user relies on the keyboard;
  2712.             ' ''' or <c>False</c> otherwise.
  2713.             ' ''' Windows NT: This value is not supported.
  2714.             ' ''' </summary>
  2715.             ' GetKeyboardPref = &H44
  2716.  
  2717.             ' ''' <summary>
  2718.             ' ''' Sets the keyboard preference.
  2719.             ' ''' The <paramref name="uiParam"/> parameter specifies <c>True</c> if the user relies on the keyboard instead of the mouse,
  2720.             ' ''' and wants applications to display keyboard interfaces that would otherwise be hidden; <paramref name="uiParam"/> is <c>False</c> otherwise.
  2721.             ' ''' Windows NT: This value is not supported.
  2722.             ' ''' </summary>
  2723.             ' SetKeyboardPref = &H45
  2724.  
  2725.             ' ''' <summary>
  2726.             ' ''' Determines whether a screen reviewer utility is running. A screen reviewer utility directs textual information to an output device,
  2727.             ' ''' such as a speech synthesizer or Braille display. When this flag is set, an application should provide textual information
  2728.             ' ''' in situations where it would otherwise present the information graphically.
  2729.             ' ''' The <paramref name="pvParam"/> parameter is a pointer to a <see cref="Boolean"/> variable that receives <c>True</c> if a screen reviewer utility is running, or <c>False</c> otherwise.
  2730.             ' ''' Windows NT:  This value is not supported.
  2731.             ' ''' </summary>
  2732.             ' GetScreenReader = &H46
  2733.  
  2734.             ' ''' <summary>
  2735.             ' ''' Determines whether a screen review utility is running. The <paramref name="uiParam"/> parameter specifies <c>True</c> for on, or <c>False</c> for off.
  2736.             ' ''' Windows NT:  This value is not supported.
  2737.             ' ''' </summary>
  2738.             ' SetScreenReader = &H47
  2739.  
  2740.             ' ''' <summary>
  2741.             ' ''' Retrieves the animation effects associated with user actions.
  2742.             ' ''' The <paramref name="pvParam"/> parameter must point to an ANIMATIONINFO structure that receives the information.
  2743.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(ANIMATIONINFO).
  2744.             ' ''' </summary>
  2745.             ' GetAnimation = &H48
  2746.  
  2747.             ' ''' <summary>
  2748.             ' ''' Sets the animation effects associated with user actions.
  2749.             ' ''' The <paramref name="pvParam"/> parameter must point to an ANIMATIONINFO structure that contains the new parameters.
  2750.             ' ''' Set the <paramref name="cbSize"/> member of this structure and the <paramref name="uiParam"/> parameter to sizeof(ANIMATIONINFO).
  2751.             ' ''' </summary>
  2752.             ' SetAnimation = &H49
  2753.  
  2754.             ' ''' <summary>
  2755.             ' ''' Retrieves the metrics associated with the nonclient area of nonminimized windows.
  2756.             ' ''' The <paramref name="pvParam"/> parameter must point to a NONCLIENTMETRICS structure that receives the information.
  2757.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(NONCLIENTMETRICS).
  2758.             ' ''' </summary>
  2759.             ' GetNonClientMetrics = &H29
  2760.  
  2761.             ' ''' <summary>
  2762.             ' ''' Sets the metrics associated with the nonclient area of nonminimized windows.
  2763.             ' ''' The <paramref name="pvParam"/> parameter must point to a NONCLIENTMETRICS structure that contains the new parameters.
  2764.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(NONCLIENTMETRICS).
  2765.             ' ''' Also, the lfHeight member of the LOGFONT structure must be a negative value.
  2766.             ' ''' </summary>
  2767.             ' SetNonClientMetrics = &H2A
  2768.  
  2769.             ' ''' <summary>
  2770.             ' ''' Retrieves the metrics associated with minimized windows.
  2771.             ' ''' The <paramref name="pvParam"/> parameter must point to a MINIMIZEDMETRICS structure that receives the information.
  2772.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(MINIMIZEDMETRICS).
  2773.             ' ''' </summary>
  2774.             ' GetMinimizedMetrics = &H2B
  2775.  
  2776.             ' ''' <summary>
  2777.             ' ''' Sets the metrics associated with minimized windows.
  2778.             ' ''' The <paramref name="pvParam"/> parameter must point to a MINIMIZEDMETRICS structure that contains the new parameters.
  2779.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(MINIMIZEDMETRICS).
  2780.             ' ''' </summary>
  2781.             ' SetMinimizedMetrics = &H2C
  2782.  
  2783.             ' ''' <summary>
  2784.             ' ''' Retrieves the metrics associated with icons.
  2785.             ' ''' The <paramref name="pvParam"/> parameter must point to an ICONMETRICS structure that receives the information.
  2786.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(ICONMETRICS).
  2787.             ' ''' </summary>
  2788.             ' GetIconMetrics = &H2D
  2789.  
  2790.             ' ''' <summary>
  2791.             ' ''' Sets the metrics associated with icons.
  2792.             ' ''' The <paramref name="pvParam"/> parameter must point to an ICONMETRICS structure that contains the new parameters.
  2793.             ' ''' Set the cbSize member of this structure and the <paramref name="uiParam"/> parameter to sizeof(ICONMETRICS).
  2794.             ' ''' </summary>
  2795.             ' SetIconMetrics = &H2E
  2796.  
  2797.             ' ''' <summary>
  2798.             ' ''' Retrieves the size of the work area on the primary display monitor.
  2799.             ' ''' The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars.
  2800.             ' ''' The <paramref name="pvParam"/> parameter must point to a RECT structure that receives
  2801.             ' ''' the coordinates of the work area, expressed in virtual screen coordinates.
  2802.             ' ''' To get the work area of a monitor other than the primary display monitor, call the GetMonitorInfo function.
  2803.             ' ''' </summary>
  2804.             ' GetWorkArea = &H30
  2805.  
  2806.             ' ''' <summary>
  2807.             ' ''' Sets the size of the work area.
  2808.             ' ''' The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars.
  2809.             ' ''' The <paramref name="pvParam"/> parameter is a pointer to a RECT structure that specifies the new work area rectangle,
  2810.             ' ''' expressed in virtual screen coordinates. In a system with multiple display monitors,
  2811.             ' ''' the function sets the work area of the monitor that contains the specified rectangle.
  2812.             ' ''' </summary>
  2813.             ' SetWorkArea = &H2F
  2814.  
  2815.             ' ''' <summary>
  2816.             ' ''' This flag is obsolete.
  2817.             ' ''' Previous versions of the system use this flag to determine whether ALT+TAB fast task switching is enabled.
  2818.             ' ''' For Windows 95, Windows 98, and Windows NT version 4.0 and later, fast task switching is always enabled.
  2819.             ' ''' </summary>
  2820.             ' GetFastTaskSwitch = &H23
  2821.  
  2822.             ' ''' <summary>
  2823.             ' ''' This flag is obsolete.
  2824.             ' ''' Previous versions of the system use this flag to enable or disable ALT+TAB fast task switching.
  2825.             ' ''' For Windows 95, Windows 98, and Windows NT version 4.0 and later, fast task switching is always enabled.
  2826.             ' ''' </summary>
  2827.             ' SetFastTaskSwitch = &H24
  2828.  
  2829.             ' ''' <summary>
  2830.             ' ''' Retrieves the logical font information for the current icon-title font.
  2831.             ' ''' The <paramref name="uiParam"/> parameter specifies the size of a LOGFONT structure,
  2832.             ' ''' and the <paramref name="pvParam"/> parameter must point to the LOGFONT structure to fill in.
  2833.             ' ''' </summary>
  2834.             ' GetIconTitleLogFont = &H1F
  2835.  
  2836.             ' ''' <summary>
  2837.             ' ''' Sets the font that is used for icon titles.
  2838.             ' ''' The <paramref name="uiParam"/> parameter specifies the size of a LOGFONT structure,
  2839.             ' ''' and the <paramref name="pvParam"/> parameter must point to a LOGFONT structure.
  2840.             ' ''' </summary>
  2841.             ' SetIconTitleLogFont = &H22
  2842.  
  2843.             ' ''' <summary>
  2844.             ' ''' Retrieves the current granularity value of the desktop sizing grid.
  2845.             ' ''' The <paramref name="pvParam"/> parameter must point to an <see cref="Integer"/> variable that receives the granularity.
  2846.             ' ''' </summary>
  2847.             ' GetGridGranularity = &H12
  2848.  
  2849.             ' ''' <summary>
  2850.             ' ''' Sets the granularity of the desktop sizing grid to the value of the <paramref name="uiParam"/> parameter.
  2851.             ' ''' </summary>
  2852.             ' SetGridGranularity = &H13
  2853.  
  2854.             ' ''' <summary>
  2855.             ' ''' Sets the current desktop pattern by causing Windows to read the Pattern= setting from the WIN.INI file.
  2856.             ' ''' </summary>
  2857.             ' SetDeskPattern = &H15
  2858.  
  2859.             ' ''' <summary>
  2860.             ' ''' Retrieves the two mouse threshold values and the mouse speed.
  2861.             ' ''' </summary>
  2862.             ' GetMouse = &H3
  2863.  
  2864.             ' ''' <summary>
  2865.             ' ''' Sets the two mouse threshold values and the mouse speed.
  2866.             ' ''' </summary>
  2867.             ' SetMouse = &H4
  2868.  
  2869.             ' ''' <summary>
  2870.             ' ''' Not implemented.
  2871.             ' ''' </summary>
  2872.             ' LangDriver = &HC
  2873.  
  2874.             ' ''' <summary>
  2875.             ' ''' Determines whether screen saving is enabled.
  2876.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that
  2877.             ' ''' receives <c>True</c> if screen saving is enabled, or <c>False</c> otherwise.
  2878.             ' ''' Does not work for Windows 7: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx
  2879.             ' ''' </summary>
  2880.             ' GetScreensaveActive = &H10
  2881.  
  2882.             ' ''' <summary>
  2883.             ' ''' Retrieves a value that determines whether Windows 8 is displaying apps using the default scaling plateau for the hardware or
  2884.             ' ''' going to the next higher plateau.
  2885.             ' ''' This value is based on the current "Make everything on your screen bigger" setting,
  2886.             ' ''' found in the Ease of Access section of PC settings: 1 is on, 0 is off.
  2887.             ' ''' </summary>
  2888.             ' GetLogicalDPIoverride = &H9E
  2889.  
  2890.             ' ''' <summary>
  2891.             ' ''' Do not use.
  2892.             ' ''' </summary>
  2893.             ' SetLogicalDPIoverride = &H9F
  2894.  
  2895.             ' ''' <summary>
  2896.             ' ''' Note  When the SPI_SETDESKWALLPAPER flag is used, SystemParametersInfo returns TRUE unless there is an error
  2897.             ' ''' (like when the specified file doesn't exist).
  2898.             ' ''' </summary>
  2899.             ' SetDeskWallpaper = &H14
  2900.  
  2901.             ' ''' <summary>
  2902.             ' ''' Retrieves the current contact visualization setting.
  2903.             ' ''' The <paramref name="pvParam"/> parameter must point to a ULONG variable that receives the setting.
  2904.             ' ''' For more information, see Contact Visualization.
  2905.             ' ''' </summary>
  2906.             ' GetContactVisualization = &H2018
  2907.  
  2908.             ' ''' <summary>
  2909.             ' ''' Sets the current contact visualization setting.
  2910.             ' ''' The <paramref name="pvParam"/> parameter must point to a ULONG variable that identifies the setting.
  2911.             ' ''' For more information, see Contact Visualization.
  2912.             ' ''' </summary>
  2913.             ' SetContactVisualization = &H2019
  2914.  
  2915.             ' ''' <summary>
  2916.             ' ''' Retrieves the current gesture visualization setting.
  2917.             ' ''' The <paramref name="pvParam"/> parameter must point to a ULONG variable that receives the setting.
  2918.             ' ''' For more information, see Gesture Visualization.
  2919.             ' ''' </summary>
  2920.             ' GetGestureVisualization = &H201A
  2921.  
  2922.             ' ''' <summary>
  2923.             ' ''' Sets the current gesture visualization setting.
  2924.             ' ''' The <paramref name="pvParam"/> parameter must point to a ULONG variable that identifies the setting.
  2925.             ' ''' For more information, see Gesture Visualization.
  2926.             ' ''' </summary>
  2927.             ' SetGestureVisualization = &H201B
  2928.  
  2929.             ' ''' <summary>
  2930.             ' ''' Retrieves the routing setting for wheel button input.
  2931.             ' ''' The routing setting determines whether wheel button input is sent to the app with focus (foreground) or the app under the mouse cursor.
  2932.             ' ''' The <paramref name="pvParam"/> parameter must point to a DWORD variable that receives the routing option.
  2933.             ' ''' If the value is zero or MOUSEWHEEL_ROUTING_FOCUS, mouse wheel input is delivered to the app with focus.
  2934.             ' ''' If the value is 1 or MOUSEWHEEL_ROUTING_HYBRID (default),
  2935.             ' ''' mouse wheel input is delivered to the app with focus (desktop apps) or the app under the mouse cursor (Windows Store apps).
  2936.             ' ''' The <paramref name="uiParam"/> parameter is not used.
  2937.             ' ''' </summary>
  2938.             ' GetMousewheelRouting = &H201C
  2939.  
  2940.             ' ''' <summary>
  2941.             ' ''' Sets the routing setting for wheel button input.
  2942.             ' ''' The routing setting determines whether wheel button input is sent to the app with focus (foreground) or the app under the mouse cursor.
  2943.             ' ''' The <paramref name="pvParam"/> parameter must point to a DWORD variable that receives the routing option.
  2944.             ' ''' If the value is zero or MOUSEWHEEL_ROUTING_FOCUS, mouse wheel input is delivered to the app with focus.
  2945.             ' ''' If the value is 1 or MOUSEWHEEL_ROUTING_HYBRID (default),
  2946.             ' ''' mouse wheel input is delivered to the app with focus (desktop apps) or the app under the mouse cursor (Windows Store apps).
  2947.             ' ''' Set the <paramref name="uiParam"/> parameter to zero
  2948.             ' ''' </summary>
  2949.             ' SetMousewheelRouting = &H201D
  2950.  
  2951.             ' ''' <summary>
  2952.             ' ''' Retrieves the current pen gesture visualization setting.
  2953.             ' ''' The <paramref name="pvParam"/> parameter must point to a ULONG variable that receives the setting.
  2954.             ' ''' For more information, see Pen Visualization.
  2955.             ' ''' </summary>
  2956.             ' GetPenVisualization = &H201E
  2957.  
  2958.             ' ''' <summary>
  2959.             ' ''' Sets the current pen gesture visualization setting.
  2960.             ' ''' The <paramref name="pvParam"/> parameter must point to a ULONG variable that identifies the setting.
  2961.             ' ''' For more information, see Pen Visualization.
  2962.             ' ''' </summary>
  2963.             ' SetPenVisualization = &H201F
  2964.  
  2965.             ' ''' <summary>
  2966.             ' ''' Starting with Windows 8: Determines whether the active input settings have Local (per-thread, <c>True</c>) or Global (session, <c>False</c>) scope.
  2967.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable.
  2968.             ' ''' </summary>
  2969.             ' GetThreadLocalInputSettings = &H104E
  2970.  
  2971.             ' ''' <summary>
  2972.             ' ''' Starting with Windows 8: Determines whether the active input settings have Local (per-thread, <c>True</c>) or Global (session, <c>False</c>) scope.
  2973.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable, casted by PVOID.
  2974.             ' ''' </summary>
  2975.             ' SetThreadLocalInputSettings = &H104F
  2976.  
  2977.             ' ''' <summary>
  2978.             ' ''' Determines whether a window is docked when it is moved to the top, left, or right edges of a monitor or monitor array.
  2979.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled, or <c>False</c> otherwise.
  2980.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  2981.             ' ''' </summary>
  2982.             ' GetDockMoving = &H90
  2983.  
  2984.             ' ''' <summary>
  2985.             ' ''' Sets whether a window is docked when it is moved to the top, left, or right docking targets on a monitor or monitor array.
  2986.             ' ''' Set <paramref name="pvParam"/> to <c>True</c> for on or <c>False</c> for off.
  2987.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  2988.             ' ''' </summary>
  2989.             ' SetDockMoving = &H91
  2990.  
  2991.             ' ''' <summary>
  2992.             ' ''' Determines whether a maximized window is restored when its caption bar is dragged.
  2993.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled, or <c>False</c> otherwise.
  2994.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  2995.             ' ''' </summary>
  2996.             ' GetDragFromMaximize = &H8C
  2997.  
  2998.             ' ''' <summary>
  2999.             ' ''' Sets whether a maximized window is restored when its caption bar is dragged.
  3000.             ' ''' Set <paramref name="pvParam"/> to <c>True</c> for on or <c>False</c> for off.
  3001.             ' ''' </summary>
  3002.             ' SetDragFromMaximize = &H8D
  3003.  
  3004.             ' ''' <summary>
  3005.             ' ''' Retrieves the threshold in pixels where docking behavior is triggered by using a mouse to drag a window to the edge of a monitor or monitor array.
  3006.             ' ''' The default threshold is 1.
  3007.             ' ''' The <paramref name="pvParam"/> parameter must point to a DWORD variable that receives the value.
  3008.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3009.             ' ''' </summary>
  3010.             ' GetMouseDockThreshold = &H7E
  3011.  
  3012.             ' ''' <summary>
  3013.             ' ''' Sets the threshold in pixels where docking behavior is triggered by using a mouse to drag a window to the edge of a monitor or monitor array.
  3014.             ' ''' The default threshold is 1.
  3015.             ' ''' The <paramref name="pvParam"/> parameter must point to a DWORD variable that contains the new value
  3016.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3017.             ' ''' </summary>
  3018.             ' SetMouseDockThreshold = &H7F
  3019.  
  3020.             ' ''' <summary>
  3021.             ' ''' Retrieves the threshold in pixels where undocking behavior is triggered by using a mouse to drag a window from the edge of a monitor or
  3022.             ' ''' a monitor array toward the center.
  3023.             ' ''' The default threshold is 20.
  3024.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3025.             ' ''' </summary>
  3026.             ' GetMouseDragoutThreshold = &H84
  3027.  
  3028.             ' ''' <summary>
  3029.             ' ''' Sets the threshold in pixels where undocking behavior is triggered by using a mouse to drag a window from the edge of a monitor or
  3030.             ' ''' monitor array to its center.
  3031.             ' ''' The default threshold is 20.
  3032.             ' ''' The <paramref name="pvParam"/> parameter must point to a DWORD variable that contains the new value.
  3033.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3034.             ' ''' </summary>
  3035.             ' SetMouseDragoutThreshold = &H85
  3036.  
  3037.             ' ''' <summary>
  3038.             ' ''' Retrieves the threshold in pixels from the top of a monitor or a monitor array where a vertically maximized window is restored when dragged with the mouse.
  3039.             ' ''' The default threshold is 50.
  3040.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3041.             ' ''' </summary>
  3042.             ' GetMouseSideMoveThreshold = &H88
  3043.  
  3044.             ' ''' <summary>
  3045.             ' ''' Sets the threshold in pixels from the top of the monitor where a vertically maximized window is restored when dragged with the mouse.
  3046.             ' ''' The default threshold is 50.
  3047.             ' ''' The <paramref name="pvParam"/> parameter must point to a DWORD variable that contains the new value
  3048.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3049.             ' ''' </summary>
  3050.             ' SetMouseSideMoveThreshold = &H89
  3051.  
  3052.             ' ''' <summary>
  3053.             ' ''' Determines whether a window is vertically maximized when it is sized to the top or bottom of a monitor or monitor array.
  3054.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled, or <c>False</c> otherwise.
  3055.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3056.             ' ''' </summary>
  3057.             ' GetSnapSizing = &H8E
  3058.  
  3059.             ' ''' <summary>
  3060.             ' ''' Sets whether a window is vertically maximized when it is sized to the top or bottom of the monitor.
  3061.             ' ''' Set <paramref name="pvParam"/> to <c>True</c> for on or <c>False</c> for off.
  3062.             ' ''' Use <see cref="EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWinArranging"/>  to determine whether this behavior is enabled.
  3063.             ' ''' </summary>
  3064.             ' SetSnapSizing = &H8F
  3065.  
  3066.             ' ''' <summary>
  3067.             ' ''' Determines whether window arrangement is enabled.
  3068.             ' ''' The <paramref name="pvParam"/> parameter must point to a <see cref="Boolean"/> variable that receives <c>True</c> if enabled, or <c>False</c> otherwise.
  3069.             ' ''' Window arrangement reduces the number of mouse, pen, or touch interactions needed to move and size top-level windows by
  3070.             ' ''' simplifying the default behavior of a window when it is dragged or sized.
  3071.             ' ''' </summary>
  3072.             ' GetWinArranging = &H82
  3073.  
  3074.             ' ''' <summary>
  3075.             ' ''' Sets whether window arrangement is enabled.
  3076.             ' ''' Set <paramref name="pvParam"/> to <c>True</c> for on or <c>False</c> for off.
  3077.             ' ''' Window arrangement reduces the number of mouse, pen, or touch interactions needed to move and size top-level windows by
  3078.             ' ''' simplifying the default behavior of a window when it is dragged or sized.
  3079.             ' ''' </summary>
  3080.             ' SetWinArranging = &H83
  3081.  
  3082.         End Enum
  3083.  
  3084.         ''' ----------------------------------------------------------------------------------------------------
  3085.         ''' <summary>
  3086.         ''' Flags for <paramref name="fWinIni"/> parameter of <see cref="EnvironmentUtil.NativeMethods.SystemParametersInfo"/> function.
  3087.         ''' </summary>
  3088.         ''' ----------------------------------------------------------------------------------------------------
  3089.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx</remarks>
  3090.         ''' ----------------------------------------------------------------------------------------------------
  3091.         <Flags>
  3092.         Friend Enum SystemParametersWinIniFlags As UInteger
  3093.  
  3094.             ''' <summary>
  3095.             ''' None.
  3096.             ''' </summary>
  3097.             None = &H0
  3098.  
  3099.             ''' <summary>
  3100.             ''' Writes the new system-wide parameter setting to the user profile.
  3101.             ''' </summary>
  3102.             UpdateIniFile = &H1
  3103.  
  3104.             ''' <summary>
  3105.             ''' Broadcasts the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message after updating the user profile.
  3106.             ''' </summary>
  3107.             SendChange = &H2
  3108.  
  3109.             ''' <summary>
  3110.             ''' Same as <see cref="EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendChange"/>.
  3111.             ''' </summary>
  3112.             SendWinIniChange = &H3
  3113.  
  3114.         End Enum
  3115.  
  3116.         ''' <summary>
  3117.         ''' The system sends or posts a system-defined message when it communicates with an application.
  3118.         ''' It uses these messages to control the operations of applications and to provide input and other information for applications to process.
  3119.         ''' An application can also send or post system-defined messages.
  3120.         ''' Applications generally use these messages to control the operation of control windows created by using preregistered window classes.
  3121.         ''' </summary>
  3122.         ''' ----------------------------------------------------------------------------------------------------
  3123.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx</remarks>
  3124.         ''' ----------------------------------------------------------------------------------------------------
  3125.         Friend Enum WindowsMessages As Integer
  3126.  
  3127.             ''' ----------------------------------------------------------------------------------------------------
  3128.             ''' <summary>
  3129.             ''' The message is sent to all top-level windows in the system, including disabled or invisible unowned windows.
  3130.             ''' The function does not return until each window has timed out.
  3131.             ''' Therefore, the total wait time can be up to the value of uTimeout multiplied by the number of top-level windows.
  3132.             ''' </summary>
  3133.             ''' ----------------------------------------------------------------------------------------------------
  3134.             ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms644952%28v=vs.85%29.aspx</remarks>
  3135.             ''' ----------------------------------------------------------------------------------------------------
  3136.             HWND_BROADCAST = &HFFFF&
  3137.  
  3138.             ''' ----------------------------------------------------------------------------------------------------
  3139.             ''' <summary>
  3140.             ''' A message that is sent to all top-level windows when
  3141.             ''' the SystemParametersInfo function changes a system-wide setting or when policy settings have changed.
  3142.             '''
  3143.             ''' Applications should send <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> to all top-level windows when
  3144.             ''' they make changes to system parameters
  3145.             ''' (This message cannot be sent directly to a single window.)
  3146.             '''
  3147.             ''' To send the <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE"/> message to all top-level windows,
  3148.             ''' use the <see cref="EnvironmentUtil.NativeMethods.SendMessageTimeout"/> function with the <paramref name="hwnd"/> parameter set to
  3149.             ''' <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.HWND_BROADCAST"/>.
  3150.             ''' </summary>
  3151.             ''' ----------------------------------------------------------------------------------------------------
  3152.             ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms725497%28v=vs.85%29.aspx</remarks>
  3153.             ''' ----------------------------------------------------------------------------------------------------
  3154.             WM_SETTINGCHANGE = &H1A
  3155.  
  3156.             ''' ----------------------------------------------------------------------------------------------------
  3157.             ''' <summary>
  3158.             ''' Message sent when the user selects a command item from a menu,
  3159.             ''' when a control sends a notification message to its parent window,
  3160.             ''' or when an accelerator keystroke is translated.
  3161.             ''' </summary>
  3162.             ''' ----------------------------------------------------------------------------------------------------
  3163.             ''' <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms647591%28v=vs.85%29.aspx</remarks>
  3164.             ''' ----------------------------------------------------------------------------------------------------
  3165.             WM_COMMAND = &H111UI
  3166.  
  3167.         End Enum
  3168.  
  3169.         ''' ----------------------------------------------------------------------------------------------------
  3170.         ''' <summary>
  3171.         ''' Specifies additional message-specific information for a System-Defined Message.
  3172.         ''' </summary>
  3173.         ''' ----------------------------------------------------------------------------------------------------
  3174.         ''' <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx#system_defined</remarks>
  3175.         ''' ----------------------------------------------------------------------------------------------------
  3176.         Friend Enum WParams As UInteger
  3177.  
  3178.             ''' <summary>
  3179.             ''' A Null WParam.
  3180.             ''' </summary>
  3181.             None = 0UI
  3182.  
  3183.             ''' <summary>
  3184.             ''' Minimize all windows.
  3185.             ''' Used with <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_COMMAND"/> message.
  3186.             ''' </summary>
  3187.             MIN_ALL = 419UI
  3188.  
  3189.             ''' <summary>
  3190.             ''' Undo the minimization of all minimized windows.
  3191.             ''' Used with <see cref="EnvironmentUtil.NativeMethods.WindowsMessages.WM_COMMAND"/> message.
  3192.             ''' </summary>
  3193.             MIN_ALL_UNDO = 416UI
  3194.  
  3195.         End Enum
  3196.  
  3197.         ''' ----------------------------------------------------------------------------------------------------
  3198.         ''' <summary>
  3199.         ''' Specifies additional message-specific information for a System-Defined Message.
  3200.         ''' </summary>
  3201.         ''' ----------------------------------------------------------------------------------------------------
  3202.         ''' <remarks>http://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx#system_defined</remarks>
  3203.         ''' ----------------------------------------------------------------------------------------------------
  3204.         Friend Enum LParams As UInteger
  3205.  
  3206.             ''' <summary>
  3207.             ''' A Null LParam.
  3208.             ''' </summary>
  3209.             None = 0UI
  3210.  
  3211.         End Enum
  3212.  
  3213. #End Region
  3214.  
  3215.     End Class
  3216.  
  3217. #End Region
  3218.  
  3219. #Region " Enumerations "
  3220.  
  3221.     ''' <summary>
  3222.     ''' Specified an environment user (registry root key).
  3223.     ''' </summary>
  3224.     Public Enum EnvironmentUser As Integer
  3225.  
  3226.         ''' <summary>
  3227.         ''' This reffers to the commonly known "HKLM" or "HKEY_LOCAL_MACHINE" registry root key.
  3228.         ''' Changes made on this registry root key will affect all users.
  3229.         ''' </summary>
  3230.         Machine = 0
  3231.  
  3232.         ''' <summary>
  3233.         ''' Current User, this reffers to the commonly known "HKCU" or "HKEY_CURRENT_USER" registry root key.
  3234.         ''' Changes made on this registry root key will affect the current user.
  3235.         ''' </summary>
  3236.         CurrentUser = 1
  3237.  
  3238.     End Enum
  3239.  
  3240. #End Region
  3241.  
  3242. #Region " Constructors "
  3243.  
  3244.     ''' ----------------------------------------------------------------------------------------------------
  3245.     ''' <summary>
  3246.     ''' Prevents a default instance of the <see cref="EnvironmentUtil"/> class from being created.
  3247.     ''' </summary>
  3248.     ''' ----------------------------------------------------------------------------------------------------
  3249.     Private Sub New()
  3250.     End Sub
  3251.  
  3252. #End Region
  3253.  
  3254. #Region " Child Classes "
  3255.  
  3256. #Region " Shell "
  3257.  
  3258.     ''' ----------------------------------------------------------------------------------------------------
  3259.     ''' <summary>
  3260.     ''' Contains related Windows desktop utilities.
  3261.     ''' </summary>
  3262.     ''' ----------------------------------------------------------------------------------------------------
  3263.     Public NotInheritable Class Shell
  3264.  
  3265. #Region " Child Classes "
  3266.  
  3267. #Region " Desktop "
  3268.  
  3269.         ''' ----------------------------------------------------------------------------------------------------
  3270.         ''' <summary>
  3271.         ''' Contains related Windows desktop utilities.
  3272.         ''' </summary>
  3273.         ''' ----------------------------------------------------------------------------------------------------
  3274.         Public NotInheritable Class Desktop
  3275.  
  3276. #Region " Constructors "
  3277.  
  3278.             ''' ----------------------------------------------------------------------------------------------------
  3279.             ''' <summary>
  3280.             ''' Prevents a default instance of the <see cref="Desktop"/> class from being created.
  3281.             ''' </summary>
  3282.             ''' ----------------------------------------------------------------------------------------------------
  3283.             <DebuggerStepThrough>
  3284.             Private Sub New()
  3285.             End Sub
  3286.  
  3287. #End Region
  3288.  
  3289. #Region " Public Methods "
  3290.  
  3291.             ''' ----------------------------------------------------------------------------------------------------
  3292.             ''' <summary>
  3293.             ''' Shows/Restores the desktop.
  3294.             ''' </summary>
  3295.             ''' ----------------------------------------------------------------------------------------------------
  3296.             <DebuggerStepThrough>
  3297.             Public Shared Sub Show()
  3298.  
  3299.                 EnvironmentUtil.NativeMethods.SendMessage(
  3300.                                               EnvironmentUtil.NativeMethods.FindWindow(EnvironmentUtil.Shell.TaskBar.ClassName, String.Empty),
  3301.                                               EnvironmentUtil.NativeMethods.WindowsMessages.WM_COMMAND,
  3302.                                               New IntPtr(EnvironmentUtil.NativeMethods.WParams.MIN_ALL_UNDO),
  3303.                                               New IntPtr(EnvironmentUtil.NativeMethods.LParams.None))
  3304.  
  3305.                 ' Dim shell As New Shell
  3306.                 ' shell.UndoMinimizeALL()
  3307.                 ' shell = Nothing
  3308.  
  3309.             End Sub
  3310.  
  3311.             ''' ----------------------------------------------------------------------------------------------------
  3312.             ''' <summary>
  3313.             ''' Hides the desktop.
  3314.             ''' </summary>
  3315.             ''' ----------------------------------------------------------------------------------------------------
  3316.             <DebuggerStepThrough>
  3317.             Public Shared Sub Hide()
  3318.  
  3319.                 EnvironmentUtil.NativeMethods.SendMessage(
  3320.                                               EnvironmentUtil.NativeMethods.FindWindow(EnvironmentUtil.Shell.TaskBar.ClassName, String.Empty),
  3321.                                               EnvironmentUtil.NativeMethods.WindowsMessages.WM_COMMAND,
  3322.                                               New IntPtr(NativeMethods.WParams.MIN_ALL),
  3323.                                               New IntPtr(NativeMethods.LParams.None))
  3324.  
  3325.                 ' Dim shell As New Shell
  3326.                 ' shell.MinimizeAll()
  3327.                 ' shell = Nothing
  3328.  
  3329.             End Sub
  3330.  
  3331.             ''' ----------------------------------------------------------------------------------------------------
  3332.             ''' <summary>
  3333.             ''' Toggles the visibility state of the desktop.
  3334.             ''' </summary>
  3335.             ''' ----------------------------------------------------------------------------------------------------
  3336.             ''' <exception cref="NotImplementedException">
  3337.             ''' This feature is not supported under Windows XP.
  3338.             ''' </exception>
  3339.             ''' ----------------------------------------------------------------------------------------------------
  3340.             <DebuggerStepThrough>
  3341.             Public Shared Sub ToggleState()
  3342.  
  3343.                 ' If current O.S = Windows Vista or above, then...
  3344.                 If Environment.OSVersion.Version.Major >= 6 Then
  3345.  
  3346.                     Dim shell As New Shell32.Shell
  3347.                     shell.ToggleDesktop()
  3348.                     shell = Nothing
  3349.  
  3350.                 Else
  3351.                     Throw New NotImplementedException(message:="This feature is not supported in Windows XP.")
  3352.  
  3353.                 End If
  3354.  
  3355.             End Sub
  3356.  
  3357.             ''' ----------------------------------------------------------------------------------------------------
  3358.             ''' <summary>
  3359.             ''' Cascades all of the windows on the desktop.
  3360.             ''' This method has the same effect as right-clicking the taskbar and selecting Cascade Windows.
  3361.             ''' </summary>
  3362.             ''' ----------------------------------------------------------------------------------------------------
  3363.             ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774067%28v=vs.85%29.aspx</remarks>
  3364.             ''' ----------------------------------------------------------------------------------------------------
  3365.             <DebuggerStepThrough>
  3366.             Public Shared Sub CascadeWindows()
  3367.  
  3368.                 Dim shell As New Shell32.Shell
  3369.                 shell.CascadeWindows()
  3370.                 shell = Nothing
  3371.  
  3372.             End Sub
  3373.  
  3374.             ''' ----------------------------------------------------------------------------------------------------
  3375.             ''' <summary>
  3376.             ''' Tiles all of the windows on the desktop horizontally.
  3377.             ''' This method has the same effect as right-clicking the taskbar and selecting Tile Windows Horizontally.
  3378.             ''' </summary>
  3379.             ''' ----------------------------------------------------------------------------------------------------
  3380.             ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774102%28v=vs.85%29.aspx</remarks>
  3381.             ''' ----------------------------------------------------------------------------------------------------
  3382.             <DebuggerStepThrough>
  3383.             Public Shared Sub TileWindowsHorizontally()
  3384.  
  3385.                 Dim shell As New Shell32.Shell
  3386.                 shell.TileHorizontally()
  3387.                 shell = Nothing
  3388.  
  3389.             End Sub
  3390.  
  3391.             ''' ----------------------------------------------------------------------------------------------------
  3392.             ''' <summary>
  3393.             ''' Tiles all of the windows on the desktop vertically.
  3394.             ''' This method has the same effect as right-clicking the taskbar and selecting Tile Windows Vertically.
  3395.             ''' </summary>
  3396.             ''' ----------------------------------------------------------------------------------------------------
  3397.             ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774104%28v=vs.85%29.aspx</remarks>
  3398.             ''' ----------------------------------------------------------------------------------------------------
  3399.             <DebuggerStepThrough>
  3400.             Public Shared Sub TileWindowsVertically()
  3401.  
  3402.                 Dim shell As New Shell32.Shell
  3403.                 shell.TileVertically()
  3404.                 shell = Nothing
  3405.  
  3406.             End Sub
  3407.  
  3408. #End Region
  3409.  
  3410.         End Class
  3411.  
  3412. #End Region
  3413.  
  3414. #Region " Explorer "
  3415.  
  3416.         ''' ----------------------------------------------------------------------------------------------------
  3417.         ''' <summary>
  3418.         ''' Contains related Windows Explorer utilities.
  3419.         ''' </summary>
  3420.         ''' ----------------------------------------------------------------------------------------------------
  3421.         Public NotInheritable Class Explorer
  3422.  
  3423. #Region " Properties "
  3424.  
  3425.             ''' ----------------------------------------------------------------------------------------------------
  3426.             ''' <summary>
  3427.             ''' Gets a <see cref="ReadOnlyCollection(Of ShellBrowserWindow)"/> containing the opened windows explorer instances.
  3428.             ''' </summary>
  3429.             ''' ----------------------------------------------------------------------------------------------------
  3430.             ''' <value>
  3431.             ''' A <see cref="ReadOnlyCollection(Of ShellBrowserWindow)"/> containing the opened windows explorer instances.
  3432.             ''' </value>
  3433.             ''' ----------------------------------------------------------------------------------------------------
  3434.             Public Shared ReadOnly Property ExplorerWindows() As ReadOnlyCollection(Of ShellBrowserWindow)
  3435.                 <DebuggerStepThrough>
  3436.                 Get
  3437.                     Return New ReadOnlyCollection(Of ShellBrowserWindow)(EnvironmentUtil.Shell.Explorer.GetExplorerWindows.ToList)
  3438.                 End Get
  3439.             End Property
  3440.  
  3441.             ''' ----------------------------------------------------------------------------------------------------
  3442.             ''' <summary>
  3443.             ''' Gets a <see cref="ReadOnlyCollection(Of folder2)"/> containing the opened windows explorer folder instances.
  3444.             ''' </summary>
  3445.             ''' ----------------------------------------------------------------------------------------------------
  3446.             ''' <value>
  3447.             ''' A <see cref="ReadOnlyCollection(Of folder2)"/> containing the opened windows explorer folder instances.
  3448.             ''' </value>
  3449.             ''' ----------------------------------------------------------------------------------------------------
  3450.             Public Shared ReadOnly Property ExplorerWindowsFolders() As ReadOnlyCollection(Of Shell32.Folder2)
  3451.                 <DebuggerStepThrough>
  3452.                 Get
  3453.                     Return New ReadOnlyCollection(Of Folder2)(EnvironmentUtil.Shell.Explorer.GetExplorerWindowsFolders.ToList)
  3454.                 End Get
  3455.             End Property
  3456.  
  3457. #End Region
  3458.  
  3459. #Region " Constructors "
  3460.  
  3461.             ''' ----------------------------------------------------------------------------------------------------
  3462.             ''' <summary>
  3463.             ''' Prevents a default instance of the <see cref="Explorer"/> class from being created.
  3464.             ''' </summary>
  3465.             ''' ----------------------------------------------------------------------------------------------------
  3466.             <DebuggerStepThrough>
  3467.             Private Sub New()
  3468.             End Sub
  3469.  
  3470. #End Region
  3471.  
  3472. #Region " Public Methods "
  3473.  
  3474.             ''' ----------------------------------------------------------------------------------------------------
  3475.             ''' <summary>
  3476.             ''' Adds an item into the Windows recent docs list (MRU).
  3477.             ''' </summary>
  3478.             ''' ----------------------------------------------------------------------------------------------------
  3479.             ''' <param name="filePath">
  3480.             ''' The file path.
  3481.             ''' </param>
  3482.             ''' ----------------------------------------------------------------------------------------------------
  3483.             ''' <exception cref="ArgumentNullException">
  3484.             ''' filePath
  3485.             ''' </exception>
  3486.             ''' ----------------------------------------------------------------------------------------------------
  3487.             ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/gg537735%28v=vs.85%29.aspx</remarks>
  3488.             ''' ----------------------------------------------------------------------------------------------------
  3489.             <DebuggerStepThrough>
  3490.             Public Shared Sub AddFileToRecentDocs(ByVal filePath As String)
  3491.  
  3492.                 If String.IsNullOrWhiteSpace(filePath) Then
  3493.                     Throw New ArgumentNullException(paramName:="filePath")
  3494.                 End If
  3495.  
  3496.                 Dim shell As New Shell32.Shell
  3497.                 shell.AddToRecent(filePath)
  3498.                 shell = Nothing
  3499.  
  3500.             End Sub
  3501.  
  3502.             ''' ----------------------------------------------------------------------------------------------------
  3503.             ''' <summary>
  3504.             ''' Refreshes the opened windows explorer folder instances.
  3505.             ''' </summary>
  3506.             ''' ----------------------------------------------------------------------------------------------------
  3507.             <DebuggerStepThrough>
  3508.             Public Shared Sub RefreshWindows()
  3509.  
  3510.                 For Each window As ShellBrowserWindow In EnvironmentUtil.Shell.Explorer.GetExplorerWindows()
  3511.                     window.Refresh()
  3512.                 Next window
  3513.  
  3514.             End Sub
  3515.  
  3516. #End Region
  3517.  
  3518. #Region " Private Methods "
  3519.  
  3520.             ''' ----------------------------------------------------------------------------------------------------
  3521.             ''' <example>
  3522.             ''' For Each window As ShellBrowserWindow In GetExplorerWindows()
  3523.             '''     Console.WriteLine(window.LocationURL)
  3524.             ''' Next window
  3525.             ''' </example>
  3526.             ''' ----------------------------------------------------------------------------------------------------
  3527.             ''' <summary>
  3528.             ''' Gets a <see cref="IEnumerable(Of ShellBrowserWindow)"/> containing the opened windows explorer instances.
  3529.             ''' </summary>
  3530.             ''' ----------------------------------------------------------------------------------------------------
  3531.             ''' <returns>
  3532.             ''' A <see cref="IEnumerable(Of ShellBrowserWindow)"/> containing the opened windows explorer instances.
  3533.             ''' </returns>
  3534.             ''' ----------------------------------------------------------------------------------------------------
  3535.             ''' <exception cref="NotImplementedException">
  3536.             ''' Detected an unknown window type.
  3537.             ''' </exception>
  3538.             ''' ----------------------------------------------------------------------------------------------------
  3539.             <DebuggerStepThrough>
  3540.             Private Shared Iterator Function GetExplorerWindows() As IEnumerable(Of ShellBrowserWindow)
  3541.  
  3542.                 Dim shell As New Shell32.Shell
  3543.  
  3544.                 For Each window As ShellBrowserWindow In DirectCast(shell.Windows, IShellWindows)
  3545.  
  3546.                     Select Case window.Document.GetType.Name
  3547.  
  3548.                         Case "HTMLDocumentClass" ' Internet Explorer Window.
  3549.                             ' Do Nothing.
  3550.  
  3551.                         Case "__ComObject" ' Explorer Window.
  3552.                             Yield window
  3553.  
  3554.                         Case Else ' Unknown window.
  3555.                             Throw New NotImplementedException("Detected an unknown window type.")
  3556.  
  3557.                     End Select
  3558.  
  3559.                 Next window
  3560.  
  3561.                 shell = Nothing
  3562.  
  3563.             End Function
  3564.  
  3565.             ''' ----------------------------------------------------------------------------------------------------
  3566.             ''' <example>
  3567.             ''' For Each folder As Folder2 In GetExplorerWindowsFolders()
  3568.             '''     Console.WriteLine(folder.Self.Path)
  3569.             ''' Next folder
  3570.             ''' </example>
  3571.             ''' ----------------------------------------------------------------------------------------------------
  3572.             ''' <summary>
  3573.             ''' Gets a <see cref="IEnumerable(Of Folder2)"/> containing the opened windows explorer folder instances.
  3574.             ''' </summary>
  3575.             ''' ----------------------------------------------------------------------------------------------------
  3576.             ''' <returns>
  3577.             ''' A <see cref="IEnumerable(Of Folder2)"/> containing the opened windows explorer folder instances.
  3578.             ''' </returns>
  3579.             ''' ----------------------------------------------------------------------------------------------------
  3580.             ''' <exception cref="NotImplementedException">
  3581.             ''' Detected an unknown window type.
  3582.             ''' </exception>
  3583.             ''' ----------------------------------------------------------------------------------------------------
  3584.             <DebuggerStepThrough>
  3585.             Private Shared Iterator Function GetExplorerWindowsFolders() As IEnumerable(Of Folder2)
  3586.  
  3587.                 Dim shell As New Shell32.Shell
  3588.  
  3589.                 For Each window As ShellBrowserWindow In DirectCast(shell.Windows, IShellWindows)
  3590.  
  3591.                     Select Case window.Document.GetType.Name
  3592.  
  3593.                         Case "HTMLDocumentClass" ' Internet Explorer Window.
  3594.                             ' Do Nothing.
  3595.  
  3596.                         Case "__ComObject" ' Explorer Window.
  3597.                             Yield DirectCast(DirectCast(window.Document, ShellFolderView).Folder, Folder2)
  3598.  
  3599.                         Case Else ' Unknown window.
  3600.                             Throw New NotImplementedException("Detected an unknown window type.")
  3601.  
  3602.                     End Select
  3603.  
  3604.                 Next window
  3605.  
  3606.                 shell = Nothing
  3607.  
  3608.             End Function
  3609.  
  3610. #End Region
  3611.  
  3612.         End Class
  3613.  
  3614. #End Region
  3615.  
  3616. #Region " StartMenu "
  3617.  
  3618.         ''' ----------------------------------------------------------------------------------------------------
  3619.         ''' <summary>
  3620.         ''' Contains related Windows startmenu utilities.
  3621.         ''' </summary>
  3622.         ''' ----------------------------------------------------------------------------------------------------
  3623.         Public NotInheritable Class StartMenu
  3624.  
  3625. #Region " Constructors "
  3626.  
  3627.             ''' ----------------------------------------------------------------------------------------------------
  3628.             ''' <summary>
  3629.             ''' Prevents a default instance of the <see cref="StartMenu"/> class from being created.
  3630.             ''' </summary>
  3631.             ''' ----------------------------------------------------------------------------------------------------
  3632.             <DebuggerStepThrough>
  3633.             Private Sub New()
  3634.             End Sub
  3635.  
  3636. #End Region
  3637.  
  3638. #Region " Public Methods "
  3639.  
  3640.             ''' ----------------------------------------------------------------------------------------------------
  3641.             ''' <summary>
  3642.             ''' Pins an item on the startmenu.
  3643.             ''' </summary>
  3644.             ''' ----------------------------------------------------------------------------------------------------
  3645.             ''' <param name="itemPath">
  3646.             ''' The file or directory path.
  3647.             ''' </param>
  3648.             ''' ----------------------------------------------------------------------------------------------------
  3649.             <DebuggerStepThrough>
  3650.             Public Shared Sub PinItem(ByVal itemPath As String)
  3651.  
  3652.                 Dim shell As New Shell32.Shell
  3653.                 Dim link As FolderItem = shell.NameSpace(Path.GetDirectoryName(itemPath)).ParseName(Path.GetFileName(itemPath))
  3654.  
  3655.                 ' HKEY_CURRENT_USER\Software\Classes\CLSID\{a2a9545d-a0c2-42b4-9708-a0b2badd77c9}
  3656.                 link.InvokeVerb("startpin")
  3657.  
  3658.             End Sub
  3659.  
  3660.             ''' ----------------------------------------------------------------------------------------------------
  3661.             ''' <summary>
  3662.             ''' Unpins an item from the startmenu.
  3663.             ''' </summary>
  3664.             ''' ----------------------------------------------------------------------------------------------------
  3665.             ''' <param name="itemPath">
  3666.             ''' The file or directory path.
  3667.             ''' </param>
  3668.             ''' ----------------------------------------------------------------------------------------------------
  3669.             <DebuggerStepThrough>
  3670.             Public Shared Sub UnpinItem(ByVal itemPath As String)
  3671.  
  3672.                 Dim shell As New Shell32.Shell
  3673.                 Dim link As FolderItem = shell.NameSpace(Path.GetDirectoryName(itemPath)).ParseName(Path.GetFileName(itemPath))
  3674.  
  3675.                 ' HKEY_CURRENT_USER\Software\Classes\CLSID\{a2a9545d-a0c2-42b4-9708-a0b2badd77c9}
  3676.                 link.InvokeVerb("startunpin")
  3677.  
  3678.             End Sub
  3679.  
  3680. #End Region
  3681.  
  3682.         End Class
  3683.  
  3684. #End Region
  3685.  
  3686. #Region " TaskBar "
  3687.  
  3688.         ''' ----------------------------------------------------------------------------------------------------
  3689.         ''' <summary>
  3690.         ''' Contains related Windows desktop's taskbar utilities.
  3691.         ''' </summary>
  3692.         ''' ----------------------------------------------------------------------------------------------------
  3693.         Public NotInheritable Class TaskBar
  3694.  
  3695. #Region " Properties "
  3696.  
  3697.             ''' ----------------------------------------------------------------------------------------------------
  3698.             ''' <summary>
  3699.             ''' Gets the taskbar class name.
  3700.             ''' </summary>
  3701.             ''' ----------------------------------------------------------------------------------------------------
  3702.             ''' <value>
  3703.             ''' The taskbar class name.
  3704.             ''' </value>
  3705.             ''' ----------------------------------------------------------------------------------------------------
  3706.             Public Shared ReadOnly Property ClassName As String
  3707.                 Get
  3708.                     Return "Shell_TrayWnd"
  3709.                 End Get
  3710.             End Property
  3711.  
  3712.             ''' ----------------------------------------------------------------------------------------------------
  3713.             ''' <summary>
  3714.             ''' Gets the taskbar window handle.
  3715.             ''' </summary>
  3716.             ''' ----------------------------------------------------------------------------------------------------
  3717.             ''' <value>
  3718.             ''' The taskbar window handle
  3719.             ''' </value>
  3720.             ''' ----------------------------------------------------------------------------------------------------
  3721.             Public Shared ReadOnly Property Hwnd As IntPtr
  3722.                 <DebuggerStepThrough>
  3723.                 Get
  3724.                     Return EnvironmentUtil.NativeMethods.FindWindow(EnvironmentUtil.Shell.TaskBar.ClassName, Nothing)
  3725.                 End Get
  3726.             End Property
  3727.  
  3728. #End Region
  3729.  
  3730. #Region " Enumerations "
  3731.  
  3732.             ''' <summary>
  3733.             ''' Specifies a desktop taskbar visibility flag.
  3734.             ''' </summary>
  3735.             Private Enum TaskBarVisibility As Integer
  3736.  
  3737.                 ''' <summary>
  3738.                 ''' Hides the TaskBar.
  3739.                 ''' </summary>
  3740.                 Hide = &H0
  3741.  
  3742.                 ''' <summary>
  3743.                 ''' Shows the TaskBar.
  3744.                 ''' </summary>
  3745.                 Show = &H5
  3746.  
  3747.             End Enum
  3748.  
  3749. #End Region
  3750.  
  3751. #Region " Constructors "
  3752.  
  3753.             ''' ----------------------------------------------------------------------------------------------------
  3754.             ''' <summary>
  3755.             ''' Prevents a default instance of the <see cref="TaskBar"/> class from being created.
  3756.             ''' </summary>
  3757.             ''' ----------------------------------------------------------------------------------------------------
  3758.             <DebuggerStepThrough>
  3759.             Private Sub New()
  3760.             End Sub
  3761.  
  3762. #End Region
  3763.  
  3764. #Region " Public Methods "
  3765.  
  3766.             ''' ----------------------------------------------------------------------------------------------------
  3767.             ''' <summary>
  3768.             ''' Hides the desktop taskbar.
  3769.             ''' </summary>
  3770.             ''' ----------------------------------------------------------------------------------------------------
  3771.             ''' <exception cref="Exception">
  3772.             ''' The taskbar was already hidden.
  3773.             ''' </exception>
  3774.             ''' ----------------------------------------------------------------------------------------------------
  3775.             <DebuggerStepThrough>
  3776.             Public Shared Sub Hide(Optional ByVal ignoreErrors As Boolean = True)
  3777.  
  3778.                 If (EnvironmentUtil.Shell.TaskBar.SetVisibility(EnvironmentUtil.Shell.TaskBar.TaskBarVisibility.Hide) = 0) AndAlso
  3779.                     Not ignoreErrors Then
  3780.  
  3781.                     Throw New Exception("The taskbar was already hidden.")
  3782.  
  3783.                 End If
  3784.  
  3785.             End Sub
  3786.  
  3787.             ''' ----------------------------------------------------------------------------------------------------
  3788.             ''' <summary>
  3789.             ''' Shows the desktop taskbar.
  3790.             ''' </summary>
  3791.             ''' ----------------------------------------------------------------------------------------------------
  3792.             ''' <exception cref="Exception">
  3793.             ''' The taskbar was already shown.
  3794.             ''' </exception>
  3795.             ''' ----------------------------------------------------------------------------------------------------
  3796.             <DebuggerStepThrough>
  3797.             Public Shared Sub Show(Optional ByVal ignoreErrors As Boolean = True)
  3798.  
  3799.                 If (EnvironmentUtil.Shell.TaskBar.SetVisibility(EnvironmentUtil.Shell.TaskBar.TaskBarVisibility.Show) <> 0) AndAlso
  3800.                     Not ignoreErrors Then
  3801.  
  3802.                     Throw New Exception("The taskbar was already shown.")
  3803.  
  3804.                 End If
  3805.  
  3806.             End Sub
  3807.  
  3808.             ''' ----------------------------------------------------------------------------------------------------
  3809.             ''' <summary>
  3810.             ''' Pins an item on TaskBar.
  3811.             ''' </summary>
  3812.             ''' ----------------------------------------------------------------------------------------------------
  3813.             ''' <param name="itemPath">
  3814.             ''' The file or directory path.
  3815.             ''' </param>
  3816.             ''' ----------------------------------------------------------------------------------------------------
  3817.             <DebuggerStepThrough>
  3818.             Public Shared Sub PinItem(ByVal itemPath As String)
  3819.  
  3820.                 Dim shell As New Shell32.Shell
  3821.                 Dim link As FolderItem = shell.NameSpace(Path.GetDirectoryName(itemPath)).ParseName(Path.GetFileName(itemPath))
  3822.  
  3823.                 ' HKEY_CLASSES_ROOT\CLSID\{90AA3A4E-1CBA-4233-B8BB-535773D48449}
  3824.                 link.InvokeVerb("taskbarpin")
  3825.  
  3826.             End Sub
  3827.  
  3828.             ''' ----------------------------------------------------------------------------------------------------
  3829.             ''' <summary>
  3830.             ''' Unpins an item from TaskBar.
  3831.             ''' </summary>
  3832.             ''' ----------------------------------------------------------------------------------------------------
  3833.             ''' <param name="itemPath">
  3834.             ''' The file or directory path.
  3835.             ''' </param>
  3836.             ''' ----------------------------------------------------------------------------------------------------
  3837.             <DebuggerStepThrough>
  3838.             Public Shared Sub UnpinItem(ByVal itemPath As String)
  3839.  
  3840.                 Dim shell As New Shell32.Shell
  3841.                 Dim link As FolderItem = shell.NameSpace(Path.GetDirectoryName(itemPath)).ParseName(Path.GetFileName(itemPath))
  3842.  
  3843.                 ' HKEY_CLASSES_ROOT\CLSID\{90AA3A4E-1CBA-4233-B8BB-535773D48449}
  3844.                 link.InvokeVerb("taskbarunpin")
  3845.  
  3846.             End Sub
  3847.  
  3848. #End Region
  3849.  
  3850. #Region " Private Methods "
  3851.  
  3852.             ''' ----------------------------------------------------------------------------------------------------
  3853.             ''' <summary>
  3854.             ''' Sets the Windows TaskBar visibility.
  3855.             ''' </summary>
  3856.             ''' ----------------------------------------------------------------------------------------------------
  3857.             ''' <param name="visibility">
  3858.             ''' The desired TaskBar visibility.
  3859.             ''' </param>
  3860.             ''' ----------------------------------------------------------------------------------------------------
  3861.             ''' <returns>
  3862.             ''' If the window was previously visible, the return value is nonzero.
  3863.             ''' If the window was previously hidden, the return value is zero.
  3864.             ''' </returns>
  3865.             ''' ----------------------------------------------------------------------------------------------------
  3866.             <DebuggerStepThrough>
  3867.             Private Shared Function SetVisibility(ByVal visibility As EnvironmentUtil.Shell.TaskBar.TaskBarVisibility) As Integer
  3868.  
  3869.                 Return EnvironmentUtil.NativeMethods.ShowWindow(EnvironmentUtil.Shell.TaskBar.Hwnd, visibility)
  3870.  
  3871.             End Function
  3872.  
  3873. #End Region
  3874.  
  3875.         End Class
  3876.  
  3877. #End Region
  3878.  
  3879. #End Region
  3880.  
  3881. #Region " Constructors "
  3882.  
  3883.         ''' <summary>
  3884.         ''' Prevents a default instance of the <see cref="EnvironmentVariables"/> class from being created.
  3885.         ''' </summary>
  3886.         Private Sub New()
  3887.         End Sub
  3888.  
  3889. #End Region
  3890.  
  3891.     End Class
  3892.  
  3893. #End Region
  3894.  
  3895. #Region " Environment Variables "
  3896.  
  3897.     ''' ----------------------------------------------------------------------------------------------------
  3898.     ''' <summary>
  3899.     ''' Contains related Windows environment variables utilities.
  3900.     ''' </summary>
  3901.     ''' ----------------------------------------------------------------------------------------------------
  3902.     <RegistryPermission(SecurityAction.Demand, Unrestricted:=True)>
  3903.     Public NotInheritable Class EnvironmentVariables
  3904.  
  3905. #Region " Types "
  3906.  
  3907. #Region " EnvironmentVariableInfo "
  3908.  
  3909.         ''' ----------------------------------------------------------------------------------------------------
  3910.         ''' <summary>
  3911.         ''' Defines the info of a Windows environment Variable.
  3912.         ''' </summary>
  3913.         ''' ----------------------------------------------------------------------------------------------------
  3914.         <Serializable>
  3915.         Public NotInheritable Class EnvironmentVariableInfo
  3916.  
  3917. #Region " Properties "
  3918.  
  3919.             ''' ----------------------------------------------------------------------------------------------------
  3920.             ''' <summary>
  3921.             ''' Gets or sets the variable name.
  3922.             ''' </summary>
  3923.             ''' ----------------------------------------------------------------------------------------------------
  3924.             ''' <value>
  3925.             ''' The variable name.
  3926.             ''' </value>
  3927.             ''' ----------------------------------------------------------------------------------------------------
  3928.             Public Property Name As String
  3929.  
  3930.             ''' ----------------------------------------------------------------------------------------------------
  3931.             ''' <summary>
  3932.             ''' Gets or sets the variable value.
  3933.             ''' </summary>
  3934.             ''' ----------------------------------------------------------------------------------------------------
  3935.             ''' <value>
  3936.             ''' The variable value.
  3937.             ''' </value>
  3938.             ''' ----------------------------------------------------------------------------------------------------
  3939.             Public Property Value As String
  3940.  
  3941. #End Region
  3942.  
  3943. #Region " Constructors "
  3944.  
  3945.             ''' <summary>
  3946.             ''' Initializes a new instance of the <see cref="EnvironmentVariableInfo"/> class.
  3947.             ''' </summary>
  3948.             Public Sub New()
  3949.             End Sub
  3950.  
  3951. #End Region
  3952.  
  3953.         End Class
  3954.  
  3955. #End Region
  3956.  
  3957. #End Region
  3958.  
  3959. #Region " Properties "
  3960.  
  3961.         ''' ----------------------------------------------------------------------------------------------------
  3962.         ''' <summary>
  3963.         ''' Gets a <see cref="IEnumerable(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)"/> collection with the environment variables of the specified environment user.
  3964.         ''' </summary>
  3965.         ''' ----------------------------------------------------------------------------------------------------
  3966.         ''' <example>
  3967.         ''' For Each envVar As EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo In EnvironmentUtil.EnvironmentVariables.CurrentVariables(EnvironmentUtil.EnvironmentUser.CurrentUser)
  3968.         '''
  3969.         '''     Console.WriteLine(String.Format("Name:{0}; Value:{1}", envVar.Name, envVar.Value))
  3970.         '''
  3971.         ''' Next envVar
  3972.         ''' </example>
  3973.         ''' ----------------------------------------------------------------------------------------------------
  3974.         ''' <value>
  3975.         ''' A <see cref="IEnumerable(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)"/> collection with the environment variables.
  3976.         ''' </value>
  3977.         ''' ----------------------------------------------------------------------------------------------------
  3978.         Public Shared ReadOnly Property CurrentVariables(ByVal environmentUser As EnvironmentUtil.EnvironmentUser) As ReadOnlyCollection(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)
  3979.             <DebuggerStepThrough>
  3980.             Get
  3981.                 Return New ReadOnlyCollection(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)(EnvironmentUtil.EnvironmentVariables.GetEnvironmentVariables(environmentUser).ToList)
  3982.             End Get
  3983.         End Property
  3984.  
  3985. #End Region
  3986.  
  3987. #Region " Constructors "
  3988.  
  3989.         ''' <summary>
  3990.         ''' Prevents a default instance of the <see cref="EnvironmentVariables"/> class from being created.
  3991.         ''' </summary>
  3992.         Private Sub New()
  3993.         End Sub
  3994.  
  3995. #End Region
  3996.  
  3997. #Region " Public Methods "
  3998.  
  3999.         ''' ----------------------------------------------------------------------------------------------------
  4000.         ''' <remarks>
  4001.         ''' Title : Register Windows environment variable.
  4002.         ''' Author: Elektro
  4003.         ''' Date  : 21-June-2015
  4004.         ''' </remarks>
  4005.         ''' ----------------------------------------------------------------------------------------------------
  4006.         ''' <example>
  4007.         ''' EnvironmentUtil.EnvironmentVariables.RegisterVariable(EnvironmentUtil.EnvironmentUser.CurrentUser, "VariableName", "Elektro is the best!", throwOnExistingVariable:=True)
  4008.         ''' </example>
  4009.         ''' ----------------------------------------------------------------------------------------------------
  4010.         ''' <summary>
  4011.         ''' Registers a Windows environment variable.
  4012.         ''' </summary>
  4013.         ''' ----------------------------------------------------------------------------------------------------
  4014.         ''' <param name="environmentUser">
  4015.         ''' The environment user that will owns the variable.
  4016.         ''' </param>
  4017.         '''
  4018.         ''' <param name="name">
  4019.         ''' The variable name.
  4020.         ''' </param>
  4021.         '''
  4022.         ''' <param name="value">
  4023.         ''' The variable value.
  4024.         ''' </param>
  4025.         '''
  4026.         ''' <param name="throwOnExistingVariable">
  4027.         ''' If <c>True</c>, raises an exception if the variable already exists.
  4028.         ''' </param>
  4029.         ''' ----------------------------------------------------------------------------------------------------
  4030.         ''' <exception cref="ArgumentNullException">
  4031.         ''' name
  4032.         ''' </exception>
  4033.         '''
  4034.         ''' <exception cref="ArgumentException">
  4035.         ''' Invalid enumeration value;environmentUser
  4036.         ''' </exception>
  4037.         '''
  4038.         ''' <exception cref="ArgumentException">
  4039.         ''' The specified variable already exists.;name
  4040.         ''' </exception>
  4041.         ''' ----------------------------------------------------------------------------------------------------
  4042.         <DebuggerStepThrough>
  4043.         Public Shared Sub RegisterVariable(ByVal environmentUser As EnvironmentUtil.EnvironmentUser,
  4044.                                            ByVal name As String,
  4045.                                            ByVal value As String,
  4046.                                            Optional ByVal throwOnExistingVariable As Boolean = False)
  4047.  
  4048.             If String.IsNullOrWhiteSpace(name) Then
  4049.                 Throw New ArgumentNullException(paramName:="name")
  4050.  
  4051.             Else
  4052.                 Dim regKey As RegistryKey
  4053.                 Dim regPath As String
  4054.  
  4055.                 Select Case environmentUser
  4056.  
  4057.                     Case environmentUser.Machine
  4058.                         regKey = Registry.LocalMachine
  4059.                         regPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
  4060.  
  4061.                     Case environmentUser.CurrentUser
  4062.                         regKey = Registry.CurrentUser
  4063.                         regPath = "Environment\"
  4064.  
  4065.                     Case Else
  4066.                         Throw New ArgumentException(message:="Invalid enumeration value.", paramName:="environmentUser")
  4067.  
  4068.                 End Select
  4069.  
  4070.                 Using regKey
  4071.  
  4072.                     If (throwOnExistingVariable) AndAlso
  4073.                        (regKey.OpenSubKey(regPath, writable:=False).GetValueNames.
  4074.                                    Any(Function(varName As String) varName.ToLower.Equals(name, StringComparison.OrdinalIgnoreCase))) Then
  4075.  
  4076.                         Throw New ArgumentException(message:="The specified variable already exists.", paramName:="name")
  4077.  
  4078.                     Else
  4079.                         regKey.OpenSubKey(regPath, writable:=True).SetValue(name, value, RegistryValueKind.String)
  4080.                         EnvironmentUtil.OS.NotifyRegistryChange("Environment")
  4081.  
  4082.                     End If
  4083.  
  4084.                 End Using
  4085.  
  4086.             End If
  4087.  
  4088.         End Sub
  4089.  
  4090.         ''' ----------------------------------------------------------------------------------------------------
  4091.         ''' <remarks>
  4092.         ''' Title : Register Windows environment variable.
  4093.         ''' Author: Elektro
  4094.         ''' Date  : 21-June-2015
  4095.         ''' </remarks>
  4096.         ''' ----------------------------------------------------------------------------------------------------
  4097.         ''' <example>
  4098.         ''' EnvironmentUtil.EnvironmentVariables.RegisterVariable(EnvironmentUtil.EnvironmentUser.CurrentUser,
  4099.         '''                                                       New EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo With {.Name = "VariableName", .Value = "Elektro is the best!"},
  4100.         '''                                                       throwOnExistingVariable:=True)
  4101.         ''' </example>
  4102.         ''' ----------------------------------------------------------------------------------------------------
  4103.         ''' <summary>
  4104.         ''' Registers a Windows environment variable.
  4105.         ''' </summary>
  4106.         ''' ----------------------------------------------------------------------------------------------------
  4107.         ''' <param name="environmentUser">
  4108.         ''' The environment user that will owns the variable.
  4109.         ''' </param>
  4110.         '''
  4111.         ''' <param name="variableInfo">
  4112.         ''' A <see cref="EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo"/> object that contains the variable data.
  4113.         ''' </param>
  4114.         '''
  4115.         ''' <param name="throwOnExistingVariable">
  4116.         ''' If <c>True</c>, raises an exception if the variable already exists.
  4117.         ''' </param>
  4118.         ''' ----------------------------------------------------------------------------------------------------
  4119.         <DebuggerStepThrough>
  4120.         Public Shared Sub RegisterVariable(ByVal environmentUser As EnvironmentUtil.EnvironmentUser,
  4121.                                            ByVal variableInfo As EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo,
  4122.                                            Optional ByVal throwOnExistingVariable As Boolean = False)
  4123.  
  4124.             EnvironmentUtil.EnvironmentVariables.RegisterVariable(environmentUser, variableInfo.Name, variableInfo.Value, throwOnExistingVariable)
  4125.  
  4126.         End Sub
  4127.  
  4128.         ''' ----------------------------------------------------------------------------------------------------
  4129.         ''' <remarks>
  4130.         ''' Title : Unregister Windows environment variable.
  4131.         ''' Author: Elektro
  4132.         ''' Date  : 21-June-2015
  4133.         ''' </remarks>
  4134.         ''' ----------------------------------------------------------------------------------------------------
  4135.         ''' <example>
  4136.         ''' EnvironmentUtil.EnvironmentVariables.UnregisterVariable(EnvironmentUtil.EnvironmentUser.CurrentUser, "VariableName", throwOnMissingVariable:=True)
  4137.         ''' </example>
  4138.         ''' ----------------------------------------------------------------------------------------------------
  4139.         ''' <summary>
  4140.         ''' Unregisters a Windows environment variable.
  4141.         ''' </summary>
  4142.         ''' ----------------------------------------------------------------------------------------------------
  4143.         ''' <param name="environmentUser">
  4144.         ''' The environment user that owns the variable.
  4145.         ''' </param>
  4146.         '''
  4147.         ''' <param name="name">
  4148.         ''' The variable name.
  4149.         ''' </param>
  4150.         '''
  4151.         ''' <param name="throwOnMissingVariable">
  4152.         ''' If <c>True</c>, raises an exception if the variable doesn't exists.
  4153.         ''' </param>
  4154.         ''' ----------------------------------------------------------------------------------------------------
  4155.         ''' <exception cref="ArgumentNullException">
  4156.         ''' name
  4157.         ''' </exception>
  4158.         '''
  4159.         ''' <exception cref="ArgumentException">
  4160.         ''' Invalid enumeration value;environmentUser
  4161.         ''' </exception>
  4162.         '''
  4163.         ''' <exception cref="ArgumentException">
  4164.         ''' The specified variable doesn't exists.;name
  4165.         ''' </exception>
  4166.         ''' ----------------------------------------------------------------------------------------------------
  4167.         <DebuggerStepThrough>
  4168.         Public Shared Sub UnregisterVariable(ByVal environmentUser As EnvironmentUtil.EnvironmentUser,
  4169.                                              ByVal name As String,
  4170.                                              Optional throwOnMissingVariable As Boolean = False)
  4171.  
  4172.             If String.IsNullOrWhiteSpace(name) Then
  4173.                 Throw New ArgumentNullException(paramName:="name")
  4174.  
  4175.             Else
  4176.                 Dim regKey As RegistryKey
  4177.                 Dim regPath As String
  4178.  
  4179.                 Select Case environmentUser
  4180.  
  4181.                     Case environmentUser.Machine
  4182.                         regKey = Registry.LocalMachine
  4183.                         regPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
  4184.  
  4185.                     Case environmentUser.CurrentUser
  4186.                         regKey = Registry.CurrentUser
  4187.                         regPath = "Environment\"
  4188.  
  4189.                     Case Else
  4190.                         Throw New ArgumentException(message:="Invalid enumeration value.", paramName:="environmentUser")
  4191.  
  4192.                 End Select
  4193.  
  4194.                 Using regKey
  4195.  
  4196.                     If (throwOnMissingVariable) AndAlso
  4197.                        Not (regKey.OpenSubKey(regPath, writable:=False).GetValueNames.
  4198.                                    Any(Function(varName As String) varName.ToLower.Equals(name, StringComparison.OrdinalIgnoreCase))) Then
  4199.  
  4200.                         Throw New ArgumentException(message:="The specified variable doesn't exists.", paramName:="name")
  4201.  
  4202.                     Else
  4203.                         regKey.OpenSubKey(regPath, writable:=True).DeleteValue(name, throwOnMissingVariable)
  4204.                         EnvironmentUtil.OS.NotifyRegistryChange("Environment")
  4205.  
  4206.                     End If
  4207.  
  4208.                 End Using
  4209.  
  4210.             End If
  4211.  
  4212.         End Sub
  4213.  
  4214.         ''' ----------------------------------------------------------------------------------------------------
  4215.         ''' <summary>
  4216.         ''' Finds an environment variable and returns a <see cref="EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo"/> object that contains the variable data.
  4217.         ''' </summary>
  4218.         ''' ----------------------------------------------------------------------------------------------------
  4219.         ''' <exanple>
  4220.         ''' Dim envVarInfo As EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo =
  4221.         '''     EnvironmentUtil.EnvironmentVariables.GetVariableInfo(EnvironmentUtil.EnvironmentUser.CurrentUser, "System32", throwOnMissingVariable:=False)
  4222.         ''' </exanple>
  4223.         ''' ----------------------------------------------------------------------------------------------------
  4224.         ''' <param name="environmentUser">
  4225.         ''' The environment user that owns the variable.
  4226.         ''' </param>
  4227.         '''
  4228.         ''' <param name="name">
  4229.         ''' The variable name.
  4230.         ''' </param>
  4231.         '''
  4232.         ''' <param name="throwOnMissingVariable">
  4233.         ''' If <c>True</c>, raises an exception if the variable doesn't exists.
  4234.         ''' </param>
  4235.         ''' ----------------------------------------------------------------------------------------------------
  4236.         ''' <exception cref="ArgumentNullException">
  4237.         ''' name
  4238.         ''' </exception>
  4239.         '''
  4240.         ''' <exception cref="ArgumentException">
  4241.         ''' Invalid enumeration value;environmentUser
  4242.         ''' </exception>
  4243.         '''
  4244.         ''' <exception cref="ArgumentException">
  4245.         ''' The specified variable doesn't exists.;name
  4246.         ''' </exception>
  4247.         ''' ----------------------------------------------------------------------------------------------------
  4248.         ''' <returns>
  4249.         ''' A <see cref="EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo"/> object that contains the variable data.
  4250.         ''' </returns>
  4251.         ''' ----------------------------------------------------------------------------------------------------
  4252.         <DebuggerStepThrough>
  4253.         Public Shared Function GetVariableInfo(ByVal environmentUser As EnvironmentUtil.EnvironmentUser,
  4254.                                                ByVal name As String,
  4255.                                                Optional throwOnMissingVariable As Boolean = False) As EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo
  4256.  
  4257.             If String.IsNullOrWhiteSpace(name) Then
  4258.                 Throw New ArgumentNullException(paramName:="name")
  4259.  
  4260.             Else
  4261.                 Dim regKey As RegistryKey
  4262.                 Dim regPath As String
  4263.  
  4264.                 Select Case environmentUser
  4265.  
  4266.                     Case environmentUser.Machine
  4267.                         regKey = Registry.LocalMachine
  4268.                         regPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
  4269.  
  4270.                     Case environmentUser.CurrentUser
  4271.                         regKey = Registry.CurrentUser
  4272.                         regPath = "Environment\"
  4273.  
  4274.                     Case Else
  4275.                         Throw New ArgumentException(message:="Invalid enumeration value.", paramName:="environmentUser")
  4276.  
  4277.                 End Select
  4278.  
  4279.                 Using regKey
  4280.  
  4281.                     If (throwOnMissingVariable) AndAlso
  4282.                        Not (regKey.OpenSubKey(regPath, writable:=False).GetValueNames.
  4283.                                    Any(Function(varName As String) varName.ToLower.Equals(name, StringComparison.OrdinalIgnoreCase))) Then
  4284.  
  4285.                         Throw New ArgumentException(message:="The specified variable doesn't exists.", paramName:="name")
  4286.  
  4287.                     Else
  4288.                         regKey = regKey.OpenSubKey(regPath, writable:=False)
  4289.  
  4290.                         Return (From valueName As String In regKey.GetValueNames
  4291.                                 Where valueName.Equals(name, StringComparison.OrdinalIgnoreCase)
  4292.                                 Select New EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo With
  4293.                                               {
  4294.                                                   .Name = valueName,
  4295.                                                   .Value = CStr(regKey.GetValue(valueName, "", RegistryValueOptions.None))
  4296.                                               }).FirstOrDefault
  4297.  
  4298.                     End If
  4299.  
  4300.                 End Using
  4301.  
  4302.             End If
  4303.  
  4304.         End Function
  4305.  
  4306.         ''' ----------------------------------------------------------------------------------------------------
  4307.         ''' <remarks>
  4308.         ''' Title : Get value of environment variable.
  4309.         ''' Author: Elektro
  4310.         ''' Date  : 23-June-2015
  4311.         ''' </remarks>
  4312.         ''' ----------------------------------------------------------------------------------------------------
  4313.         ''' <example>
  4314.         ''' EnvironmentUtil.EnvironmentVariables.GetValue(EnvironmentUtil.EnvironmentUser.CurrentUser, "System32", throwOnMissingVariable:=True)
  4315.         ''' </example>
  4316.         ''' ----------------------------------------------------------------------------------------------------
  4317.         ''' <summary>
  4318.         ''' Returns the value of the specified environment variable.
  4319.         ''' </summary>
  4320.         ''' ----------------------------------------------------------------------------------------------------
  4321.         ''' <param name="environmentUser">
  4322.         ''' The environment user that owns the variable.
  4323.         ''' </param>
  4324.         '''
  4325.         ''' <param name="name">
  4326.         ''' The variable name.
  4327.         ''' </param>
  4328.         '''
  4329.         ''' <param name="throwOnMissingVariable">
  4330.         ''' If <c>True</c>, raises an exception if the variable doesn't exists.
  4331.         ''' </param>
  4332.         ''' ----------------------------------------------------------------------------------------------------
  4333.         ''' <exception cref="ArgumentNullException">
  4334.         ''' name
  4335.         ''' </exception>
  4336.         '''
  4337.         ''' <exception cref="ArgumentException">
  4338.         ''' Invalid enumeration value;environmentUser
  4339.         ''' </exception>
  4340.         '''
  4341.         ''' <exception cref="ArgumentException">
  4342.         ''' The specified variable doesn't exists.;name
  4343.         ''' </exception>
  4344.         ''' ----------------------------------------------------------------------------------------------------
  4345.         ''' <returns>
  4346.         ''' The value of the specified environment variable.
  4347.         ''' </returns>
  4348.         ''' ----------------------------------------------------------------------------------------------------
  4349.         <DebuggerStepThrough>
  4350.         Public Shared Function GetValue(ByVal environmentUser As EnvironmentUtil.EnvironmentUser,
  4351.                                         ByVal name As String,
  4352.                                         Optional throwOnMissingVariable As Boolean = False) As String
  4353.  
  4354.             If String.IsNullOrWhiteSpace(name) Then
  4355.                 Throw New ArgumentNullException(paramName:="name")
  4356.  
  4357.             Else
  4358.                 Dim regKey As RegistryKey
  4359.                 Dim regPath As String
  4360.  
  4361.                 Select Case environmentUser
  4362.  
  4363.                     Case environmentUser.Machine
  4364.                         regKey = Registry.LocalMachine
  4365.                         regPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
  4366.  
  4367.                     Case environmentUser.CurrentUser
  4368.                         regKey = Registry.CurrentUser
  4369.                         regPath = "Environment\"
  4370.  
  4371.                     Case Else
  4372.                         Throw New ArgumentException(message:="Invalid enumeration value.", paramName:="environmentUser")
  4373.  
  4374.                 End Select
  4375.  
  4376.                 Using regKey
  4377.  
  4378.                     If (throwOnMissingVariable) AndAlso
  4379.                        Not (regKey.OpenSubKey(regPath, writable:=False).GetValueNames.
  4380.                                    Any(Function(varName As String) varName.ToLower.Equals(name, StringComparison.OrdinalIgnoreCase))) Then
  4381.  
  4382.                         Throw New ArgumentException(message:="The specified variable doesn't exists.", paramName:="name")
  4383.  
  4384.                     Else
  4385.                         Return CStr(regKey.OpenSubKey(regPath, writable:=False).GetValue(name, "", RegistryValueOptions.None))
  4386.  
  4387.                     End If
  4388.  
  4389.                 End Using
  4390.  
  4391.             End If
  4392.  
  4393.         End Function
  4394.  
  4395. #End Region
  4396.  
  4397. #Region " Private Methods "
  4398.  
  4399.         ''' ----------------------------------------------------------------------------------------------------
  4400.         ''' <summary>
  4401.         ''' Gets a <see cref="IEnumerable(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)"/> collection with the
  4402.         ''' environment variables of the specified environment user.
  4403.         ''' </summary>
  4404.         ''' ----------------------------------------------------------------------------------------------------
  4405.         ''' <param name="environmentUser">
  4406.         ''' The environment user that owns the variable.
  4407.         ''' </param>
  4408.         ''' ----------------------------------------------------------------------------------------------------
  4409.         ''' <exception cref="ArgumentException">
  4410.         ''' Invalid enumeration value;environmentUser
  4411.         ''' </exception>
  4412.         ''' ----------------------------------------------------------------------------------------------------
  4413.         ''' <returns>
  4414.         ''' A <see cref="IEnumerable(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)"/> collection with the environment variables.
  4415.         ''' </returns>
  4416.         ''' ----------------------------------------------------------------------------------------------------
  4417.         <DebuggerStepThrough>
  4418.         Private Shared Function GetEnvironmentVariables(ByVal environmentUser As EnvironmentUtil.EnvironmentUser) As IEnumerable(Of EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo)
  4419.  
  4420.             Dim regKey As RegistryKey
  4421.             Dim regPath As String
  4422.  
  4423.             Select Case environmentUser
  4424.  
  4425.                 Case environmentUser.Machine
  4426.                     regKey = Registry.LocalMachine
  4427.                     regPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
  4428.  
  4429.                 Case environmentUser.CurrentUser
  4430.                     regKey = Registry.CurrentUser
  4431.                     regPath = "Environment\"
  4432.  
  4433.                 Case Else
  4434.                     Throw New ArgumentException(message:="Invalid enumeration value.", paramName:="environmentUser")
  4435.  
  4436.             End Select
  4437.  
  4438.             Using regKey
  4439.  
  4440.                 regKey = regKey.OpenSubKey(regPath, writable:=False)
  4441.  
  4442.                 Return From valueName As String In regKey.GetValueNames
  4443.                        Select New EnvironmentUtil.EnvironmentVariables.EnvironmentVariableInfo With
  4444.                                       {
  4445.                                           .Name = valueName,
  4446.                                           .Value = CStr(regKey.GetValue(valueName, "", RegistryValueOptions.None))
  4447.                                       }
  4448.  
  4449.             End Using
  4450.  
  4451.         End Function
  4452.  
  4453. #End Region
  4454.  
  4455.     End Class
  4456.  
  4457. #End Region
  4458.  
  4459. #Region " FileSystem "
  4460.  
  4461.     ''' ----------------------------------------------------------------------------------------------------
  4462.     ''' <summary>
  4463.     ''' Contains related windows file system utilities.
  4464.     ''' </summary>
  4465.     ''' ----------------------------------------------------------------------------------------------------
  4466.     Public NotInheritable Class FileSystem
  4467.  
  4468. #Region " Constructors "
  4469.  
  4470.         ''' ----------------------------------------------------------------------------------------------------
  4471.         ''' <summary>
  4472.         ''' Prevents a default instance of the <see cref="FileSystem"/> class from being created.
  4473.         ''' </summary>
  4474.         ''' ----------------------------------------------------------------------------------------------------
  4475.         <DebuggerStepThrough>
  4476.         Private Sub New()
  4477.         End Sub
  4478.  
  4479. #End Region
  4480.  
  4481. #Region " Public Methods "
  4482.  
  4483.         ''' ----------------------------------------------------------------------------------------------------
  4484.         ''' <summary>
  4485.         ''' Determines whether a directory name or file name contains invalid windows path characters.
  4486.         ''' </summary>
  4487.         ''' ----------------------------------------------------------------------------------------------------
  4488.         ''' <param name="itemName">
  4489.         ''' The item name.
  4490.         ''' </param>
  4491.         ''' ----------------------------------------------------------------------------------------------------
  4492.         ''' <returns>
  4493.         ''' <c>true</c> if item contains invalid windows name characters, <c>false</c> otherwise.
  4494.         ''' </returns>
  4495.         ''' ----------------------------------------------------------------------------------------------------
  4496.         <DebuggerStepThrough>
  4497.         Public Shared Function ItemNameIsInvalid(ByVal itemName As String) As Boolean
  4498.  
  4499.             Return itemName.Any(Function(c As Char) Path.GetInvalidFileNameChars.Contains(c))
  4500.  
  4501.         End Function
  4502.  
  4503.         ''' ----------------------------------------------------------------------------------------------------
  4504.         ''' <summary>
  4505.         ''' Determines whether a directory path or a file path contains invalid windows path characters.
  4506.         ''' </summary>
  4507.         ''' ----------------------------------------------------------------------------------------------------
  4508.         ''' <param name="itemPath">
  4509.         ''' The item path.
  4510.         ''' </param>
  4511.         ''' ----------------------------------------------------------------------------------------------------
  4512.         ''' <returns>
  4513.         ''' <c>true</c> if item contains invalid windows path characters, <c>false</c> otherwise.
  4514.         ''' </returns>
  4515.         ''' ----------------------------------------------------------------------------------------------------
  4516.         <DebuggerStepThrough>
  4517.         Public Shared Function ItemPathIsInvalid(ByVal itemPath As String) As Boolean
  4518.  
  4519.             Return itemPath.Any(Function(c As Char) Path.GetInvalidPathChars.Contains(c))
  4520.  
  4521.         End Function
  4522.  
  4523.         ''' ----------------------------------------------------------------------------------------------------
  4524.         ''' <summary>
  4525.         ''' Determines whether the specified item is a name or a path,
  4526.         ''' then, determines whether the item contains invalid windows name or path characters.
  4527.         ''' </summary>
  4528.         ''' ----------------------------------------------------------------------------------------------------
  4529.         ''' <param name="itemNameOrPath">
  4530.         ''' The item name or path.
  4531.         ''' </param>
  4532.         ''' ----------------------------------------------------------------------------------------------------
  4533.         ''' <returns>
  4534.         ''' <c>true</c> if item contains invalid windows name characters, <c>false</c> otherwise.
  4535.         ''' </returns>
  4536.         ''' ----------------------------------------------------------------------------------------------------
  4537.         <DebuggerStepThrough>
  4538.         Public Shared Function ItemNameOrPathIsInvalid(ByVal itemNameOrPath As String) As Boolean
  4539.  
  4540.             Try
  4541.                 Path.GetDirectoryName(itemNameOrPath)
  4542.                 ' It's a item path.
  4543.                 Return EnvironmentUtil.FileSystem.ItemPathIsInvalid(itemNameOrPath)
  4544.  
  4545.             Catch ex As ArgumentException
  4546.                 ' It's a item name.
  4547.                 Return EnvironmentUtil.FileSystem.ItemNameIsInvalid(itemNameOrPath)
  4548.  
  4549.             End Try
  4550.  
  4551.         End Function
  4552.  
  4553.         ''' ----------------------------------------------------------------------------------------------------
  4554.         ''' <summary>
  4555.         ''' Gets the avaliable item verbs of the specified file or directory.
  4556.         ''' </summary>
  4557.         ''' ----------------------------------------------------------------------------------------------------
  4558.         ''' <param name="itemPath">
  4559.         ''' The item path.
  4560.         ''' </param>
  4561.         ''' ----------------------------------------------------------------------------------------------------
  4562.         ''' <returns>
  4563.         ''' An <see cref="IEnumerable(Of FolderItemVerb)"/> containing the avaliable item verbs.
  4564.         ''' </returns>
  4565.         ''' ----------------------------------------------------------------------------------------------------
  4566.         <DebuggerStepThrough>
  4567.         Public Shared Function GetItemVerbs(ByVal itemPath As String) As IEnumerable(Of FolderItemVerb)
  4568.  
  4569.             Dim shell As New Shell32.Shell
  4570.             Dim link As FolderItem = shell.NameSpace(Path.GetDirectoryName(itemPath)).ParseName(Path.GetFileName(itemPath))
  4571.  
  4572.             Return link.Verbs.Cast(Of FolderItemVerb)()
  4573.  
  4574.         End Function
  4575.  
  4576.         ''' ----------------------------------------------------------------------------------------------------
  4577.         ''' <summary>
  4578.         ''' Invokes an item verb on the specified file or directory.
  4579.         ''' </summary>
  4580.         ''' ----------------------------------------------------------------------------------------------------
  4581.         ''' <param name="itemPath">
  4582.         ''' The item path.
  4583.         ''' </param>
  4584.         '''
  4585.         ''' <param name="verbName">
  4586.         ''' The verb name.
  4587.         ''' </param>
  4588.         ''' ----------------------------------------------------------------------------------------------------
  4589.         <DebuggerStepThrough>
  4590.         Public Shared Sub InvokeItemVerb(ByVal itemPath As String,
  4591.                                          ByVal verbName As String)
  4592.  
  4593.             Dim shell As New Shell32.Shell
  4594.             Dim link As FolderItem = shell.NameSpace(Path.GetDirectoryName(itemPath)).ParseName(Path.GetFileName(itemPath))
  4595.  
  4596.             link.InvokeVerb(verbName)
  4597.  
  4598.         End Sub
  4599.  
  4600. #End Region
  4601.  
  4602.     End Class
  4603.  
  4604. #End Region
  4605.  
  4606. #Region " Operating System "
  4607.  
  4608.     ''' ----------------------------------------------------------------------------------------------------
  4609.     ''' <summary>
  4610.     ''' Contains related operating system utilities.
  4611.     ''' </summary>
  4612.     ''' ----------------------------------------------------------------------------------------------------
  4613.     Public NotInheritable Class OS
  4614.  
  4615. #Region " Properties "
  4616.  
  4617.         ''' ----------------------------------------------------------------------------------------------------
  4618.         ''' <summary>
  4619.         ''' Determines whether the architecture of the current operating system is 32 or 64 Bits.
  4620.         ''' </summary>
  4621.         ''' ----------------------------------------------------------------------------------------------------
  4622.         ''' <value>
  4623.         ''' An <see cref="Architecture"></see> object that specifies the architecture of the current operating system.
  4624.         ''' </value>
  4625.         ''' ----------------------------------------------------------------------------------------------------
  4626.         Public Shared ReadOnly Property CurrentArchitecture As Architecture
  4627.             <DebuggerStepThrough>
  4628.             Get
  4629.                 Return If(Environment.Is64BitOperatingSystem,
  4630.                           Architecture.X64,
  4631.                           Architecture.X86)
  4632.             End Get
  4633.         End Property
  4634.  
  4635.         ''' ----------------------------------------------------------------------------------------------------
  4636.         ''' <summary>
  4637.         ''' Gets or sets the current screensaver filepath.
  4638.         ''' </summary>
  4639.         ''' ----------------------------------------------------------------------------------------------------
  4640.         ''' <value>
  4641.         ''' The current screensaver filepath.
  4642.         ''' </value>
  4643.         ''' ----------------------------------------------------------------------------------------------------
  4644.         Public Shared Property ScreensaverPath As String
  4645.  
  4646.             <DebuggerStepThrough>
  4647.             Get
  4648.                 Using regkey As RegistryKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop")
  4649.                     Return CStr(regkey.GetValue("SCRNSAVE.EXE", String.Empty, RegistryValueOptions.None))
  4650.                 End Using
  4651.             End Get
  4652.  
  4653.             <DebuggerStepThrough>
  4654.             Set(ByVal value As String)
  4655.                 Using regkey As RegistryKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop")
  4656.                     regkey.SetValue("SCRNSAVE.EXE", value, RegistryValueKind.String)
  4657.                 End Using
  4658.             End Set
  4659.  
  4660.         End Property
  4661.  
  4662.         ''' ----------------------------------------------------------------------------------------------------
  4663.         ''' <summary>
  4664.         ''' Gets or sets the number of milliseconds that the service control manager waits before
  4665.         ''' terminating a service that does not respond to a shutdown request.
  4666.         ''' </summary>
  4667.         ''' ----------------------------------------------------------------------------------------------------
  4668.         ''' <value>
  4669.         ''' The number of milliseconds that the service control manager waits before
  4670.         ''' terminating a service that does not respond to a shutdown request.
  4671.         ''' </value>
  4672.         ''' ----------------------------------------------------------------------------------------------------
  4673.         ''' <exception cref="Win32Exception">
  4674.         ''' </exception>
  4675.         '''
  4676.         ''' <exception cref="ArgumentException">
  4677.         ''' Value should be between 0 and 2147483647;value
  4678.         ''' </exception>
  4679.         ''' ----------------------------------------------------------------------------------------------------
  4680.         Public Shared Property WaitToKillServiceTimeout As Integer
  4681.  
  4682.             <DebuggerStepThrough>
  4683.             Get
  4684.                 Dim result As UInteger
  4685.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWaitToKillServiceTimeout,
  4686.                                                               0UI,
  4687.                                                               result,
  4688.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  4689.  
  4690.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4691.                 End If
  4692.                 Return CInt(result)
  4693.             End Get
  4694.  
  4695.             <DebuggerStepThrough>
  4696.             Set(ByVal value As Integer)
  4697.                 If (value < 0) OrElse (value > Integer.MaxValue) Then
  4698.                     Throw New ArgumentException(message:="Value should be between 0 and 2147483647.", paramName:="value")
  4699.  
  4700.                 Else
  4701.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetWaitToKillServiceTimeout,
  4702.                                                                               value,
  4703.                                                                               0UI,
  4704.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  4705.  
  4706.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4707.                     End If
  4708.                 End If
  4709.             End Set
  4710.  
  4711.         End Property
  4712.  
  4713.         ''' ----------------------------------------------------------------------------------------------------
  4714.         ''' <summary>
  4715.         ''' Gets or sets the number of milliseconds that the system waits before
  4716.         ''' terminating an application that does not respond to a shutdown request.
  4717.         ''' </summary>
  4718.         ''' ----------------------------------------------------------------------------------------------------
  4719.         ''' <value>
  4720.         ''' The number of milliseconds that the system waits before
  4721.         ''' terminating an application that does not respond to a shutdown request.
  4722.         ''' </value>
  4723.         ''' ----------------------------------------------------------------------------------------------------
  4724.         ''' <exception cref="Win32Exception">
  4725.         ''' </exception>
  4726.         '''
  4727.         ''' <exception cref="ArgumentException">
  4728.         ''' Value should be between 0 and 2147483647;value
  4729.         ''' </exception>
  4730.         ''' ----------------------------------------------------------------------------------------------------
  4731.         Public Shared Property WaitToKillAppTimeout As Integer
  4732.  
  4733.             <DebuggerStepThrough>
  4734.             Get
  4735.                 Dim result As UInteger
  4736.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWaitToKillTimeout,
  4737.                                                               0UI,
  4738.                                                               result,
  4739.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  4740.  
  4741.                     '   Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4742.                 End If
  4743.                 Return CInt(result)
  4744.             End Get
  4745.  
  4746.             <DebuggerStepThrough>
  4747.             Set(ByVal value As Integer)
  4748.                 If (value < 0) OrElse (value > Integer.MaxValue) Then
  4749.                     Throw New ArgumentException(message:="Value should be between 0 and 2147483647.", paramName:="value")
  4750.  
  4751.                 Else
  4752.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetWaitToKillTimeout,
  4753.                                                                               value,
  4754.                                                                               0UI,
  4755.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  4756.  
  4757.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4758.                     End If
  4759.                 End If
  4760.             End Set
  4761.  
  4762.         End Property
  4763.  
  4764.         ''' ----------------------------------------------------------------------------------------------------
  4765.         ''' <summary>
  4766.         ''' Gets or sets the number of milliseconds that a thread can go without dispatching a message before the system considers it unresponsive.
  4767.         ''' </summary>
  4768.         ''' ----------------------------------------------------------------------------------------------------
  4769.         ''' <value>
  4770.         ''' The number of milliseconds that a thread can go without dispatching a message before the system considers it unresponsive.
  4771.         ''' </value>
  4772.         ''' ----------------------------------------------------------------------------------------------------
  4773.         ''' <exception cref="Win32Exception">
  4774.         ''' </exception>
  4775.         '''
  4776.         ''' <exception cref="ArgumentException">
  4777.         ''' Value should be between 0 and 2147483647;value
  4778.         ''' </exception>
  4779.         ''' ----------------------------------------------------------------------------------------------------
  4780.         Public Shared Property HungAppTimeout As Integer
  4781.  
  4782.             <DebuggerStepThrough>
  4783.             Get
  4784.                 Dim result As UInteger
  4785.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetHungAppTimeout,
  4786.                                                               0UI,
  4787.                                                               result,
  4788.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  4789.  
  4790.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4791.                 End If
  4792.                 Return CInt(result)
  4793.             End Get
  4794.  
  4795.             <DebuggerStepThrough>
  4796.             Set(ByVal value As Integer)
  4797.                 If (value < 0) OrElse (value > Integer.MaxValue) Then
  4798.                     Throw New ArgumentException(message:="Value should be between 0 and 2147483647.", paramName:="value")
  4799.  
  4800.                 Else
  4801.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetHungAppTimeout,
  4802.                                                                               value,
  4803.                                                                               0UI,
  4804.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  4805.  
  4806.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4807.                     End If
  4808.                 End If
  4809.             End Set
  4810.  
  4811.         End Property
  4812.  
  4813.         ''' ----------------------------------------------------------------------------------------------------
  4814.         ''' <summary>
  4815.         ''' Gets or sets a value that determines whether the screen saver requires a password to display the Windows desktop.
  4816.         ''' </summary>
  4817.         ''' ----------------------------------------------------------------------------------------------------
  4818.         ''' <value>
  4819.         ''' <c>True</c> if the screen saver requires a password to display the Windows desktop, <c>False</c> otherwise.
  4820.         ''' </value>
  4821.         ''' ----------------------------------------------------------------------------------------------------
  4822.         ''' <exception cref="Win32Exception">
  4823.         ''' </exception>
  4824.         ''' ----------------------------------------------------------------------------------------------------
  4825.         Public Shared Property ScreensaveSecureEnabled As Boolean
  4826.  
  4827.             <DebuggerStepThrough>
  4828.             Get
  4829.                 Dim result As Boolean
  4830.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetScreensaveSecure,
  4831.                                                                 0UI,
  4832.                                                                 result,
  4833.                                                                 EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  4834.  
  4835.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4836.                 End If
  4837.                 Return result
  4838.             End Get
  4839.  
  4840.             <DebuggerStepThrough>
  4841.             Set(ByVal value As Boolean)
  4842.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetScreensaveSecure,
  4843.                                                                           value,
  4844.                                                                           0UI,
  4845.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  4846.  
  4847.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4848.                 End If
  4849.             End Set
  4850.  
  4851.         End Property
  4852.  
  4853.         ''' ----------------------------------------------------------------------------------------------------
  4854.         ''' <summary>
  4855.         ''' Gets or sets the number of characters to scroll when the horizontal mouse wheel is moved.
  4856.         ''' </summary>
  4857.         ''' ----------------------------------------------------------------------------------------------------
  4858.         ''' <value>
  4859.         ''' The number of characters to scroll when the horizontal mouse wheel is moved.
  4860.         ''' </value>
  4861.         ''' ----------------------------------------------------------------------------------------------------
  4862.         ''' <exception cref="Win32Exception">
  4863.         ''' </exception>
  4864.         '''
  4865.         ''' <exception cref="ArgumentException">
  4866.         ''' Value should be between 0 and 2147483647;value
  4867.         ''' </exception>
  4868.         ''' ----------------------------------------------------------------------------------------------------
  4869.         Public Shared Property WheelscrollChars As Integer
  4870.  
  4871.             <DebuggerStepThrough>
  4872.             Get
  4873.                 Dim result As UInteger
  4874.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetWheelscrollChars,
  4875.                                                               0UI,
  4876.                                                               result,
  4877.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  4878.  
  4879.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4880.                 End If
  4881.                 Return CInt(result)
  4882.             End Get
  4883.  
  4884.             <DebuggerStepThrough>
  4885.             Set(ByVal value As Integer)
  4886.                 If (value < 0) OrElse (value > Integer.MaxValue) Then
  4887.                     Throw New ArgumentException(message:="Value should be between 0 and 2147483647.", paramName:="value")
  4888.  
  4889.                 Else
  4890.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetWheelscrollChars,
  4891.                                                                               value,
  4892.                                                                               0UI,
  4893.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  4894.  
  4895.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4896.                     End If
  4897.                 End If
  4898.             End Set
  4899.  
  4900.         End Property
  4901.  
  4902.         ''' ----------------------------------------------------------------------------------------------------
  4903.         ''' <summary>
  4904.         ''' Gets or sets a value that determines whether the system language bar is enabled.
  4905.         ''' </summary>
  4906.         ''' ----------------------------------------------------------------------------------------------------
  4907.         ''' <value>
  4908.         ''' <c>True</c> if the system language bar is enabled, <c>False</c> otherwise.
  4909.         ''' </value>
  4910.         ''' ----------------------------------------------------------------------------------------------------
  4911.         ''' <exception cref="Win32Exception">
  4912.         ''' </exception>
  4913.         ''' ----------------------------------------------------------------------------------------------------
  4914.         Public Shared Property SystemLanguageBarEnabled As Boolean
  4915.  
  4916.             <DebuggerStepThrough>
  4917.             Get
  4918.                 Dim result As Boolean
  4919.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetSystemlanguageBar,
  4920.                                                                 0UI,
  4921.                                                                 result,
  4922.                                                                 EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  4923.  
  4924.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4925.                 End If
  4926.                 Return result
  4927.             End Get
  4928.  
  4929.             <DebuggerStepThrough>
  4930.             Set(ByVal value As Boolean)
  4931.                 Dim int32value As Integer = 0
  4932.                 If value Then
  4933.                     int32value = 1
  4934.                 End If
  4935.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetSystemlanguageBar,
  4936.                                                                           0UI,
  4937.                                                                           int32value,
  4938.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  4939.  
  4940.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4941.                 End If
  4942.             End Set
  4943.  
  4944.         End Property
  4945.  
  4946.         ''' ----------------------------------------------------------------------------------------------------
  4947.         ''' <summary>
  4948.         ''' Gets or sets a value that determines whether ClearType feature is enabled.
  4949.         ''' </summary>
  4950.         ''' ----------------------------------------------------------------------------------------------------
  4951.         ''' <value>
  4952.         ''' <c>True</c> if ClearType is enabled, <c>False</c> otherwise.
  4953.         ''' </value>
  4954.         ''' ----------------------------------------------------------------------------------------------------
  4955.         ''' <exception cref="Win32Exception">
  4956.         ''' </exception>
  4957.         ''' ----------------------------------------------------------------------------------------------------
  4958.         Public Shared Property CleartypeEnabled As Boolean
  4959.  
  4960.             <DebuggerStepThrough>
  4961.             Get
  4962.                 Dim result As Boolean
  4963.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetCleartype,
  4964.                                                                 0UI,
  4965.                                                                 result,
  4966.                                                                 EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  4967.  
  4968.                     '  Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4969.                 End If
  4970.                 Return result
  4971.             End Get
  4972.  
  4973.             <DebuggerStepThrough>
  4974.             Set(ByVal value As Boolean)
  4975.                 Dim int32value As Integer = 0
  4976.                 If value Then
  4977.                     int32value = 1
  4978.                 End If
  4979.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetCleartype,
  4980.                                                                           0UI,
  4981.                                                                           int32value,
  4982.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  4983.  
  4984.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  4985.                 End If
  4986.             End Set
  4987.  
  4988.         End Property
  4989.  
  4990.         ''' ----------------------------------------------------------------------------------------------------
  4991.         ''' <summary>
  4992.         ''' Gets or sets a value that determines whether animation effects in the client area of applications are enabled.
  4993.         ''' </summary>
  4994.         ''' ----------------------------------------------------------------------------------------------------
  4995.         ''' <value>
  4996.         ''' <c>True</c> if effects are enabled, <c>False</c> otherwise.
  4997.         ''' </value>
  4998.         ''' ----------------------------------------------------------------------------------------------------
  4999.         ''' <exception cref="Win32Exception">
  5000.         ''' </exception>
  5001.         ''' ----------------------------------------------------------------------------------------------------
  5002.         Public Shared Property ClientAreaAnimationEnabled As Boolean
  5003.  
  5004.             <DebuggerStepThrough>
  5005.             Get
  5006.                 Dim result As Boolean
  5007.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetClientAreaAnimation,
  5008.                                                                 0UI,
  5009.                                                                 result,
  5010.                                                                 EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5011.  
  5012.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5013.                 End If
  5014.                 Return result
  5015.             End Get
  5016.  
  5017.             <DebuggerStepThrough>
  5018.             Set(ByVal value As Boolean)
  5019.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetClientAreaAnimation,
  5020.                                                                           0UI,
  5021.                                                                           value,
  5022.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5023.  
  5024.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5025.                 End If
  5026.             End Set
  5027.  
  5028.         End Property
  5029.  
  5030.         ''' ----------------------------------------------------------------------------------------------------
  5031.         ''' <summary>
  5032.         ''' Gets or sets a value that determines whether overlapped content is enabled.
  5033.         ''' </summary>
  5034.         ''' ----------------------------------------------------------------------------------------------------
  5035.         ''' <value>
  5036.         ''' <c>True</c> if overlapped content is enabled, <c>False</c> otherwise.
  5037.         ''' </value>
  5038.         ''' ----------------------------------------------------------------------------------------------------
  5039.         ''' <exception cref="Win32Exception">
  5040.         ''' </exception>
  5041.         ''' ----------------------------------------------------------------------------------------------------
  5042.         Public Shared Property OverlappedContentEnabled As Boolean
  5043.  
  5044.             <DebuggerStepThrough>
  5045.             Get
  5046.                 Dim result As Boolean
  5047.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetDisableOverlappedContent,
  5048.                                                                 0UI,
  5049.                                                                 result,
  5050.                                                                 EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5051.  
  5052.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5053.                 End If
  5054.                 Return result
  5055.             End Get
  5056.  
  5057.             <DebuggerStepThrough>
  5058.             Set(ByVal value As Boolean)
  5059.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDisableOverlappedContent,
  5060.                                                                           0UI,
  5061.                                                                           value,
  5062.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5063.  
  5064.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5065.                 End If
  5066.             End Set
  5067.  
  5068.         End Property
  5069.  
  5070.         ''' ----------------------------------------------------------------------------------------------------
  5071.         ''' <summary>
  5072.         ''' Gets or sets a value that enables or disables the font smoothing feature,
  5073.         ''' which uses font antialiasing to make font curves appear smoother by painting pixels at different gray levels.
  5074.         ''' </summary>
  5075.         ''' ----------------------------------------------------------------------------------------------------
  5076.         ''' <value>
  5077.         ''' <c>True</c> if font smoothing is enabled, <c>False</c> otherwise.
  5078.         ''' </value>
  5079.         ''' ----------------------------------------------------------------------------------------------------
  5080.         ''' <exception cref="Win32Exception">
  5081.         ''' </exception>
  5082.         ''' ----------------------------------------------------------------------------------------------------
  5083.         Public Shared Property FontSmoothingEnabled As Boolean
  5084.  
  5085.             <DebuggerStepThrough>
  5086.             Get
  5087.                 Return SystemInformation.IsFontSmoothingEnabled
  5088.             End Get
  5089.  
  5090.             <DebuggerStepThrough>
  5091.             Set(ByVal value As Boolean)
  5092.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetFontSmoothing,
  5093.                                                                           value,
  5094.                                                                           0UI,
  5095.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5096.  
  5097.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5098.                 End If
  5099.             End Set
  5100.  
  5101.         End Property
  5102.  
  5103.         ''' ----------------------------------------------------------------------------------------------------
  5104.         ''' <summary>
  5105.         ''' Gets or sets a value that enables or disables dragging of full windows.
  5106.         ''' </summary>
  5107.         ''' ----------------------------------------------------------------------------------------------------
  5108.         ''' <value>
  5109.         ''' <c>True</c> if dragging is enabled, <c>False</c> otherwise.
  5110.         ''' </value>
  5111.         ''' ----------------------------------------------------------------------------------------------------
  5112.         ''' <exception cref="Win32Exception">
  5113.         ''' </exception>
  5114.         ''' ----------------------------------------------------------------------------------------------------
  5115.         Public Shared Property DragFullWindowsEnabled As Boolean
  5116.  
  5117.             <DebuggerStepThrough>
  5118.             Get
  5119.                 Return SystemInformation.DragFullWindows
  5120.             End Get
  5121.  
  5122.             <DebuggerStepThrough>
  5123.             Set(ByVal value As Boolean)
  5124.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDragFullWindows,
  5125.                                                                           value,
  5126.                                                                           0UI,
  5127.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5128.  
  5129.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5130.                 End If
  5131.             End Set
  5132.  
  5133.         End Property
  5134.  
  5135.         ''' ----------------------------------------------------------------------------------------------------
  5136.         ''' <summary>
  5137.         ''' Gets or sets a value that swaps or restores the meaning of the left and right mouse buttons.
  5138.         ''' </summary>
  5139.         ''' ----------------------------------------------------------------------------------------------------
  5140.         ''' <value>
  5141.         ''' <c>True</c> if mouse swap is enabled, <c>False</c> otherwise.
  5142.         ''' </value>
  5143.         ''' ----------------------------------------------------------------------------------------------------
  5144.         ''' <exception cref="Win32Exception">
  5145.         ''' </exception>
  5146.         ''' ----------------------------------------------------------------------------------------------------
  5147.         Public Shared Property MouseButtonsSwapEnabled As Boolean
  5148.  
  5149.             <DebuggerStepThrough>
  5150.             Get
  5151.                 Return SystemInformation.MouseButtonsSwapped
  5152.             End Get
  5153.  
  5154.             <DebuggerStepThrough>
  5155.             Set(ByVal value As Boolean)
  5156.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMousebuttonSwap,
  5157.                                                                           value,
  5158.                                                                           0UI,
  5159.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5160.  
  5161.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5162.                 End If
  5163.             End Set
  5164.  
  5165.         End Property
  5166.  
  5167.         ''' ----------------------------------------------------------------------------------------------------
  5168.         ''' <summary>
  5169.         ''' Gets or sets a value that determines whether UI effects are enabled.
  5170.         ''' </summary>
  5171.         ''' ----------------------------------------------------------------------------------------------------
  5172.         ''' <value>
  5173.         ''' <c>True</c> if UI effects are enabled, <c>False</c> otherwise.
  5174.         ''' </value>
  5175.         ''' ----------------------------------------------------------------------------------------------------
  5176.         ''' <exception cref="Win32Exception">
  5177.         ''' </exception>
  5178.         ''' ----------------------------------------------------------------------------------------------------
  5179.         Public Shared Property UIEffectsEnabled As Boolean
  5180.  
  5181.             <DebuggerStepThrough>
  5182.             Get
  5183.                 Return SystemInformation.UIEffectsEnabled
  5184.             End Get
  5185.  
  5186.             <DebuggerStepThrough>
  5187.             Set(ByVal value As Boolean)
  5188.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetUiEffects,
  5189.                                                                           0UI,
  5190.                                                                           value,
  5191.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5192.  
  5193.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5194.                 End If
  5195.             End Set
  5196.  
  5197.         End Property
  5198.  
  5199.         ''' ----------------------------------------------------------------------------------------------------
  5200.         ''' <summary>
  5201.         ''' Gets or sets a value that determines whether an application can reset the screensaver's timer by calling the SendInput function
  5202.         ''' to simulate keyboard or mouse input.
  5203.         ''' </summary>
  5204.         ''' ----------------------------------------------------------------------------------------------------
  5205.         ''' <value>
  5206.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5207.         ''' </value>
  5208.         ''' ----------------------------------------------------------------------------------------------------
  5209.         ''' <exception cref="Win32Exception">
  5210.         ''' </exception>
  5211.         ''' ----------------------------------------------------------------------------------------------------
  5212.         Public Shared Property BlockSendInputResetsEnabled As Boolean
  5213.  
  5214.             <DebuggerStepThrough>
  5215.             Get
  5216.                 Dim result As Boolean
  5217.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetBlockSendInputResets,
  5218.                                                                           0I,
  5219.                                                                           result,
  5220.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5221.  
  5222.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5223.                 End If
  5224.                 Return result
  5225.             End Get
  5226.  
  5227.             <DebuggerStepThrough>
  5228.             Set(ByVal value As Boolean)
  5229.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetBlockSendInputResets,
  5230.                                                                           Not value,
  5231.                                                                           0UI,
  5232.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5233.  
  5234.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5235.                 End If
  5236.             End Set
  5237.  
  5238.         End Property
  5239.  
  5240.         ''' ----------------------------------------------------------------------------------------------------
  5241.         ''' <summary>
  5242.         ''' Gets or sets a value that determines whether flat menu appearance for native User menus are enabled.
  5243.         ''' </summary>
  5244.         ''' ----------------------------------------------------------------------------------------------------
  5245.         ''' <value>
  5246.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5247.         ''' </value>
  5248.         ''' ----------------------------------------------------------------------------------------------------
  5249.         ''' <exception cref="Win32Exception">
  5250.         ''' </exception>
  5251.         ''' ----------------------------------------------------------------------------------------------------
  5252.         Public Shared Property FlatMenuEnabled As Boolean
  5253.  
  5254.             <DebuggerStepThrough>
  5255.             Get
  5256.                 Return SystemInformation.IsFlatMenuEnabled
  5257.             End Get
  5258.  
  5259.             <DebuggerStepThrough>
  5260.             Set(ByVal value As Boolean)
  5261.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetFlatMenu,
  5262.                                                                           0I,
  5263.                                                                           value,
  5264.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5265.  
  5266.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5267.                 End If
  5268.             End Set
  5269.  
  5270.         End Property
  5271.  
  5272.         ''' ----------------------------------------------------------------------------------------------------
  5273.         ''' <summary>
  5274.         ''' Gets or sets a value that determines whether mouse vanish feature is enabled.
  5275.         ''' </summary>
  5276.         ''' ----------------------------------------------------------------------------------------------------
  5277.         ''' <value>
  5278.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5279.         ''' </value>
  5280.         ''' ----------------------------------------------------------------------------------------------------
  5281.         ''' <exception cref="Win32Exception">
  5282.         ''' </exception>
  5283.         ''' ----------------------------------------------------------------------------------------------------
  5284.         Public Shared Property MouseVanishEnabled As Boolean
  5285.  
  5286.             <DebuggerStepThrough>
  5287.             Get
  5288.                 Dim result As Boolean
  5289.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetMouseVanish,
  5290.                                                                           0I,
  5291.                                                                           result,
  5292.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5293.  
  5294.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5295.                 End If
  5296.                 Return result
  5297.             End Get
  5298.  
  5299.             <DebuggerStepThrough>
  5300.             Set(ByVal value As Boolean)
  5301.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseVanish,
  5302.                                                                           0I,
  5303.                                                                           value,
  5304.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5305.  
  5306.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5307.                 End If
  5308.             End Set
  5309.  
  5310.         End Property
  5311.  
  5312.         ''' ----------------------------------------------------------------------------------------------------
  5313.         ''' <summary>
  5314.         ''' Gets or sets a value that determines whether mouse clicklock feature is enabled.
  5315.         ''' </summary>
  5316.         ''' ----------------------------------------------------------------------------------------------------
  5317.         ''' <value>
  5318.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5319.         ''' </value>
  5320.         ''' ----------------------------------------------------------------------------------------------------
  5321.         ''' <exception cref="Win32Exception">
  5322.         ''' </exception>
  5323.         ''' ----------------------------------------------------------------------------------------------------
  5324.         Public Shared Property MouseClickLockEnabled As Boolean
  5325.  
  5326.             <DebuggerStepThrough>
  5327.             Get
  5328.                 Dim result As Boolean
  5329.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetMouseClickLock,
  5330.                                                                           0I,
  5331.                                                                           result,
  5332.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5333.  
  5334.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5335.                 End If
  5336.                 Return result
  5337.             End Get
  5338.  
  5339.             <DebuggerStepThrough>
  5340.             Set(ByVal value As Boolean)
  5341.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseClickLock,
  5342.                                                                           value,
  5343.                                                                           0UI,
  5344.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5345.  
  5346.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5347.                 End If
  5348.             End Set
  5349.  
  5350.         End Property
  5351.  
  5352.         ''' ----------------------------------------------------------------------------------------------------
  5353.         ''' <summary>
  5354.         ''' Gets or sets a value that determines whether mouse sonar feature is enabled.
  5355.         ''' </summary>
  5356.         ''' ----------------------------------------------------------------------------------------------------
  5357.         ''' <value>
  5358.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5359.         ''' </value>
  5360.         ''' ----------------------------------------------------------------------------------------------------
  5361.         ''' <exception cref="Win32Exception">
  5362.         ''' </exception>
  5363.         ''' ----------------------------------------------------------------------------------------------------
  5364.         Public Shared Property MouseSonarEnabled As Boolean
  5365.  
  5366.             <DebuggerStepThrough>
  5367.             Get
  5368.                 Dim result As Boolean
  5369.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetMouseSonar,
  5370.                                                                           0I,
  5371.                                                                           result,
  5372.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5373.  
  5374.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5375.                 End If
  5376.                 Return result
  5377.             End Get
  5378.  
  5379.             <DebuggerStepThrough>
  5380.             Set(ByVal value As Boolean)
  5381.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseSonar,
  5382.                                                                           0I,
  5383.                                                                           value,
  5384.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5385.  
  5386.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5387.                 End If
  5388.             End Set
  5389.  
  5390.         End Property
  5391.  
  5392.         ''' ----------------------------------------------------------------------------------------------------
  5393.         ''' <summary>
  5394.         ''' Gets or sets a value that determines whether the cursor has a shadow around it.
  5395.         ''' </summary>
  5396.         ''' ----------------------------------------------------------------------------------------------------
  5397.         ''' <value>
  5398.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5399.         ''' </value>
  5400.         ''' ----------------------------------------------------------------------------------------------------
  5401.         ''' <exception cref="Win32Exception">
  5402.         ''' </exception>
  5403.         ''' ----------------------------------------------------------------------------------------------------
  5404.         Public Shared Property CursorShadowEnabled As Boolean
  5405.  
  5406.             <DebuggerStepThrough>
  5407.             Get
  5408.                 Dim result As Boolean
  5409.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetCursorShadow,
  5410.                                                                           0I,
  5411.                                                                           result,
  5412.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5413.  
  5414.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5415.                 End If
  5416.                 Return result
  5417.             End Get
  5418.  
  5419.             <DebuggerStepThrough>
  5420.             Set(ByVal value As Boolean)
  5421.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetCursorShadow,
  5422.                                                                           0I,
  5423.                                                                           value,
  5424.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5425.  
  5426.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5427.                 End If
  5428.             End Set
  5429.  
  5430.         End Property
  5431.  
  5432.         ''' ----------------------------------------------------------------------------------------------------
  5433.         ''' <summary>
  5434.         ''' Gets or sets a value that determines whether drop shadow effect feature is enabled.
  5435.         ''' </summary>
  5436.         ''' ----------------------------------------------------------------------------------------------------
  5437.         ''' <value>
  5438.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5439.         ''' </value>
  5440.         ''' ----------------------------------------------------------------------------------------------------
  5441.         ''' <exception cref="Win32Exception">
  5442.         ''' </exception>
  5443.         ''' ----------------------------------------------------------------------------------------------------
  5444.         Public Shared Property DropShadowEnabled As Boolean
  5445.  
  5446.             <DebuggerStepThrough>
  5447.             Get
  5448.                 Return SystemInformation.IsDropShadowEnabled
  5449.             End Get
  5450.  
  5451.             <DebuggerStepThrough>
  5452.             Set(ByVal value As Boolean)
  5453.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDropShadow,
  5454.                                                                           0I,
  5455.                                                                           value,
  5456.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5457.  
  5458.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5459.                 End If
  5460.             End Set
  5461.  
  5462.         End Property
  5463.  
  5464.         ''' ----------------------------------------------------------------------------------------------------
  5465.         ''' <summary>
  5466.         ''' Gets or sets a value that determines whether a selected menu item by the user should remain on the screen briefly while fading out
  5467.         ''' after the menu is dismissed.
  5468.         ''' </summary>
  5469.         ''' ----------------------------------------------------------------------------------------------------
  5470.         ''' <value>
  5471.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5472.         ''' </value>
  5473.         ''' ----------------------------------------------------------------------------------------------------
  5474.         ''' <exception cref="Win32Exception">
  5475.         ''' </exception>
  5476.         ''' ----------------------------------------------------------------------------------------------------
  5477.         Public Shared Property SelectionFadeEnabled As Boolean
  5478.  
  5479.             <DebuggerStepThrough>
  5480.             Get
  5481.                 Return SystemInformation.IsSelectionFadeEnabled
  5482.             End Get
  5483.  
  5484.             <DebuggerStepThrough>
  5485.             Set(ByVal value As Boolean)
  5486.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetSelectionFade,
  5487.                                                                           0I,
  5488.                                                                           value,
  5489.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5490.  
  5491.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5492.                 End If
  5493.             End Set
  5494.  
  5495.         End Property
  5496.  
  5497.         ''' ----------------------------------------------------------------------------------------------------
  5498.         ''' <summary>
  5499.         ''' Gets or sets a value that determines whether menu fade animation is enabled.
  5500.         ''' </summary>
  5501.         ''' ----------------------------------------------------------------------------------------------------
  5502.         ''' <value>
  5503.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5504.         ''' </value>
  5505.         ''' ----------------------------------------------------------------------------------------------------
  5506.         ''' <exception cref="Win32Exception">
  5507.         ''' </exception>
  5508.         ''' ----------------------------------------------------------------------------------------------------
  5509.         Public Shared Property MenuFadeEnabled As Boolean
  5510.  
  5511.             <DebuggerStepThrough>
  5512.             Get
  5513.                 Return SystemInformation.IsMenuFadeEnabled
  5514.             End Get
  5515.  
  5516.             <DebuggerStepThrough>
  5517.             Set(ByVal value As Boolean)
  5518.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMenuFade,
  5519.                                                                           0I,
  5520.                                                                           value,
  5521.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5522.  
  5523.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5524.                 End If
  5525.             End Set
  5526.  
  5527.         End Property
  5528.  
  5529.         ''' ----------------------------------------------------------------------------------------------------
  5530.         ''' <summary>
  5531.         ''' Gets or sets a value that determines whether hot tracking of user-interface elements such as menu names on menu bars is enabled.
  5532.         ''' Hot-tracking means that when the cursor moves over an item, it is highlighted but not selected.
  5533.         ''' </summary>
  5534.         ''' ----------------------------------------------------------------------------------------------------
  5535.         ''' <value>
  5536.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5537.         ''' </value>
  5538.         ''' ----------------------------------------------------------------------------------------------------
  5539.         ''' <exception cref="Win32Exception">
  5540.         ''' </exception>
  5541.         ''' ----------------------------------------------------------------------------------------------------
  5542.         Public Shared Property HotTrackingEnabled As Boolean
  5543.  
  5544.             <DebuggerStepThrough>
  5545.             Get
  5546.                 Return SystemInformation.IsHotTrackingEnabled
  5547.             End Get
  5548.  
  5549.             <DebuggerStepThrough>
  5550.             Set(ByVal value As Boolean)
  5551.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetHotTracking,
  5552.                                                                           0I,
  5553.                                                                           value,
  5554.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5555.  
  5556.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5557.                 End If
  5558.             End Set
  5559.  
  5560.         End Property
  5561.  
  5562.         ''' ----------------------------------------------------------------------------------------------------
  5563.         ''' <summary>
  5564.         ''' Gets or sets a value that determines whether underlining of menu access key letters is enabled.
  5565.         ''' </summary>
  5566.         ''' ----------------------------------------------------------------------------------------------------
  5567.         ''' <value>
  5568.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5569.         ''' </value>
  5570.         ''' ----------------------------------------------------------------------------------------------------
  5571.         ''' <exception cref="Win32Exception">
  5572.         ''' </exception>
  5573.         ''' ----------------------------------------------------------------------------------------------------
  5574.         Public Shared Property MenuAccessKeysUnderlined As Boolean
  5575.  
  5576.             <DebuggerStepThrough>
  5577.             Get
  5578.                 Return SystemInformation.MenuAccessKeysUnderlined
  5579.             End Get
  5580.  
  5581.             <DebuggerStepThrough>
  5582.             Set(ByVal value As Boolean)
  5583.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetKeyboardCues,
  5584.                                                                           0UI,
  5585.                                                                           value,
  5586.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5587.  
  5588.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5589.                 End If
  5590.             End Set
  5591.  
  5592.         End Property
  5593.  
  5594.         ''' ----------------------------------------------------------------------------------------------------
  5595.         ''' <summary>
  5596.         ''' Gets or sets a value that determines whether the gradient effect for window title bars are enabled.
  5597.         ''' </summary>
  5598.         ''' ----------------------------------------------------------------------------------------------------
  5599.         ''' <value>
  5600.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5601.         ''' </value>
  5602.         ''' ----------------------------------------------------------------------------------------------------
  5603.         ''' <exception cref="Win32Exception">
  5604.         ''' </exception>
  5605.         ''' ----------------------------------------------------------------------------------------------------
  5606.         Public Shared Property TitleBarGradientEnabled As Boolean
  5607.  
  5608.             <DebuggerStepThrough>
  5609.             Get
  5610.                 Return SystemInformation.IsTitleBarGradientEnabled
  5611.             End Get
  5612.  
  5613.             <DebuggerStepThrough>
  5614.             Set(ByVal value As Boolean)
  5615.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetGradientCaptions,
  5616.                                                                           0UI,
  5617.                                                                           value,
  5618.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5619.  
  5620.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5621.                 End If
  5622.             End Set
  5623.  
  5624.         End Property
  5625.  
  5626.         ''' ----------------------------------------------------------------------------------------------------
  5627.         ''' <summary>
  5628.         ''' Gets or sets a value that determines whether the smooth-scrolling effect for list boxes is enabled.
  5629.         ''' </summary>
  5630.         ''' ----------------------------------------------------------------------------------------------------
  5631.         ''' <value>
  5632.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5633.         ''' </value>
  5634.         ''' ----------------------------------------------------------------------------------------------------
  5635.         ''' <exception cref="Win32Exception">
  5636.         ''' </exception>
  5637.         ''' ----------------------------------------------------------------------------------------------------
  5638.         Public Shared Property ListBoxSmoothScrollingEnabled As Boolean
  5639.  
  5640.             <DebuggerStepThrough>
  5641.             Get
  5642.                 Return SystemInformation.IsListBoxSmoothScrollingEnabled
  5643.             End Get
  5644.  
  5645.             <DebuggerStepThrough>
  5646.             Set(ByVal value As Boolean)
  5647.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetListboxSmoothScrolling,
  5648.                                                                           0UI,
  5649.                                                                           value,
  5650.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5651.  
  5652.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5653.                 End If
  5654.             End Set
  5655.  
  5656.         End Property
  5657.  
  5658.         ''' ----------------------------------------------------------------------------------------------------
  5659.         ''' <summary>
  5660.         ''' Gets or sets a value that determines whether ToolTip animations are enabled.
  5661.         ''' </summary>
  5662.         ''' ----------------------------------------------------------------------------------------------------
  5663.         ''' <value>
  5664.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5665.         ''' </value>
  5666.         ''' ----------------------------------------------------------------------------------------------------
  5667.         ''' <exception cref="Win32Exception">
  5668.         ''' </exception>
  5669.         ''' ----------------------------------------------------------------------------------------------------
  5670.         Public Shared Property ToolTipAnimationEnabled As Boolean
  5671.  
  5672.             <DebuggerStepThrough>
  5673.             Get
  5674.                 Return SystemInformation.IsToolTipAnimationEnabled
  5675.             End Get
  5676.  
  5677.             <DebuggerStepThrough>
  5678.             Set(ByVal value As Boolean)
  5679.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetTooltipAnimation,
  5680.                                                                           0UI,
  5681.                                                                           value,
  5682.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5683.  
  5684.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5685.                 End If
  5686.             End Set
  5687.  
  5688.         End Property
  5689.  
  5690.         ''' ----------------------------------------------------------------------------------------------------
  5691.         ''' <summary>
  5692.         ''' Gets or sets a value that determines whether the slide-open effect for combo boxes is enabled.
  5693.         ''' </summary>
  5694.         ''' ----------------------------------------------------------------------------------------------------
  5695.         ''' <value>
  5696.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5697.         ''' </value>
  5698.         ''' ----------------------------------------------------------------------------------------------------
  5699.         ''' <exception cref="Win32Exception">
  5700.         ''' </exception>
  5701.         ''' ----------------------------------------------------------------------------------------------------
  5702.         Public Shared Property ComboBoxAnimationEnabled As Boolean
  5703.  
  5704.             <DebuggerStepThrough>
  5705.             Get
  5706.                 Return SystemInformation.IsComboBoxAnimationEnabled
  5707.             End Get
  5708.  
  5709.             <DebuggerStepThrough>
  5710.             Set(ByVal value As Boolean)
  5711.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetComboboxAnimation,
  5712.                                                                           0UI,
  5713.                                                                           value,
  5714.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5715.  
  5716.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5717.                 End If
  5718.             End Set
  5719.  
  5720.         End Property
  5721.  
  5722.         ''' ----------------------------------------------------------------------------------------------------
  5723.         ''' <summary>
  5724.         ''' Gets or sets a value that determines whether menu animations are enabled.
  5725.         ''' </summary>
  5726.         ''' ----------------------------------------------------------------------------------------------------
  5727.         ''' <value>
  5728.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5729.         ''' </value>
  5730.         ''' ----------------------------------------------------------------------------------------------------
  5731.         ''' <exception cref="Win32Exception">
  5732.         ''' </exception>
  5733.         ''' ----------------------------------------------------------------------------------------------------
  5734.         Public Shared Property MenuAnimationEnabled As Boolean
  5735.  
  5736.             <DebuggerStepThrough>
  5737.             Get
  5738.                 Return SystemInformation.IsMenuAnimationEnabled
  5739.             End Get
  5740.  
  5741.             <DebuggerStepThrough>
  5742.             Set(ByVal value As Boolean)
  5743.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMenuAnimation,
  5744.                                                                           0UI,
  5745.                                                                           value,
  5746.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5747.  
  5748.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5749.                 End If
  5750.             End Set
  5751.  
  5752.         End Property
  5753.  
  5754.         ''' ----------------------------------------------------------------------------------------------------
  5755.         ''' <summary>
  5756.         ''' Gets or sets a value that determines whether active window tracking (activating the window the mouse is on) is enabled.
  5757.         ''' </summary>
  5758.         ''' ----------------------------------------------------------------------------------------------------
  5759.         ''' <value>
  5760.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5761.         ''' </value>
  5762.         ''' ----------------------------------------------------------------------------------------------------
  5763.         ''' <exception cref="Win32Exception">
  5764.         ''' </exception>
  5765.         ''' ----------------------------------------------------------------------------------------------------
  5766.         Public Shared Property ActiveWindowTrackingEnabled As Boolean
  5767.  
  5768.             <DebuggerStepThrough>
  5769.             Get
  5770.                 Return SystemInformation.IsActiveWindowTrackingEnabled
  5771.             End Get
  5772.  
  5773.             <DebuggerStepThrough>
  5774.             Set(ByVal value As Boolean)
  5775.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetActiveWindowTracking,
  5776.                                                                           0UI,
  5777.                                                                           value,
  5778.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5779.  
  5780.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5781.                 End If
  5782.             End Set
  5783.  
  5784.         End Property
  5785.  
  5786.         ''' ----------------------------------------------------------------------------------------------------
  5787.         ''' <summary>
  5788.         ''' Gets or sets a value that determines whether the snap-to-default-button feature is enabled.
  5789.         ''' </summary>
  5790.         ''' ----------------------------------------------------------------------------------------------------
  5791.         ''' <value>
  5792.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5793.         ''' </value>
  5794.         ''' ----------------------------------------------------------------------------------------------------
  5795.         ''' <exception cref="Win32Exception">
  5796.         ''' </exception>
  5797.         ''' ----------------------------------------------------------------------------------------------------
  5798.         Public Shared Property SnapToDefaultEnabled As Boolean
  5799.  
  5800.             <DebuggerStepThrough>
  5801.             Get
  5802.                 Return SystemInformation.IsSnapToDefaultEnabled
  5803.             End Get
  5804.  
  5805.             <DebuggerStepThrough>
  5806.             Set(ByVal value As Boolean)
  5807.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetSnapToDefButton,
  5808.                                                                           value,
  5809.                                                                           0UI,
  5810.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5811.  
  5812.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5813.                 End If
  5814.             End Set
  5815.  
  5816.         End Property
  5817.  
  5818.         ''' ----------------------------------------------------------------------------------------------------
  5819.         ''' <summary>
  5820.         ''' Gets or sets a value that determines whether cursor movements shows a trail of cursors.
  5821.         ''' </summary>
  5822.         ''' ----------------------------------------------------------------------------------------------------
  5823.         ''' <value>
  5824.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5825.         ''' </value>
  5826.         ''' ----------------------------------------------------------------------------------------------------
  5827.         ''' <exception cref="Win32Exception">
  5828.         ''' </exception>
  5829.         ''' ----------------------------------------------------------------------------------------------------
  5830.         Public Shared ReadOnly Property MouseTrailEnabled As Boolean
  5831.  
  5832.             <DebuggerStepThrough>
  5833.             Get
  5834.                 Dim result As UInteger
  5835.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetMouseTrails,
  5836.                                                               0UI,
  5837.                                                               result,
  5838.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5839.  
  5840.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5841.                 End If
  5842.  
  5843.                 Select Case result
  5844.  
  5845.                     Case 0UI, 1UI
  5846.                         Return False
  5847.  
  5848.                     Case Else
  5849.                         Return True
  5850.  
  5851.                 End Select
  5852.  
  5853.             End Get
  5854.  
  5855.         End Property
  5856.  
  5857.         ''' ----------------------------------------------------------------------------------------------------
  5858.         ''' <summary>
  5859.         ''' Gets or sets a value that determines whether screensaver is enabled.
  5860.         ''' </summary>
  5861.         ''' ----------------------------------------------------------------------------------------------------
  5862.         ''' <value>
  5863.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5864.         ''' </value>
  5865.         ''' ----------------------------------------------------------------------------------------------------
  5866.         ''' <exception cref="Win32Exception">
  5867.         ''' </exception>
  5868.         ''' ----------------------------------------------------------------------------------------------------
  5869.         Public Shared Property ScreensaverEnabled As Boolean
  5870.  
  5871.             <DebuggerStepThrough>
  5872.             Get
  5873.                 Using regkey As RegistryKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop")
  5874.                     Return CBool(regkey.GetValue("ScreenSaveActive", False, RegistryValueOptions.None))
  5875.                 End Using
  5876.             End Get
  5877.  
  5878.             <DebuggerStepThrough>
  5879.             Set(ByVal value As Boolean)
  5880.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetScreensaveActive,
  5881.                                                                           value,
  5882.                                                                           0UI,
  5883.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5884.  
  5885.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5886.                 End If
  5887.             End Set
  5888.  
  5889.         End Property
  5890.  
  5891.         ''' ----------------------------------------------------------------------------------------------------
  5892.         ''' <summary>
  5893.         ''' Gets or sets a value that determines whether icon-title wrapping is enabled.
  5894.         ''' </summary>
  5895.         ''' ----------------------------------------------------------------------------------------------------
  5896.         ''' <value>
  5897.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5898.         ''' </value>
  5899.         ''' ----------------------------------------------------------------------------------------------------
  5900.         ''' <exception cref="Win32Exception">
  5901.         ''' </exception>
  5902.         ''' ----------------------------------------------------------------------------------------------------
  5903.         Public Shared Property IconTitleWrappingEnabled As Boolean
  5904.  
  5905.             <DebuggerStepThrough>
  5906.             Get
  5907.                 Return SystemInformation.IsIconTitleWrappingEnabled
  5908.             End Get
  5909.  
  5910.             <DebuggerStepThrough>
  5911.             Set(ByVal value As Boolean)
  5912.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetIconTitleWrap,
  5913.                                                                           value,
  5914.                                                                           0UI,
  5915.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  5916.  
  5917.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5918.                 End If
  5919.             End Set
  5920.  
  5921.         End Property
  5922.  
  5923.         ''' ----------------------------------------------------------------------------------------------------
  5924.         ''' <summary>
  5925.         ''' Gets or sets a value that determines whether system beep is enabled.
  5926.         ''' </summary>
  5927.         ''' ----------------------------------------------------------------------------------------------------
  5928.         ''' <value>
  5929.         ''' <c>True</c> if enabled, <c>False</c> otherwise.
  5930.         ''' </value>
  5931.         ''' ----------------------------------------------------------------------------------------------------
  5932.         ''' <exception cref="Win32Exception">
  5933.         ''' </exception>
  5934.         ''' ----------------------------------------------------------------------------------------------------
  5935.         Public Shared Property BeepEnabled As Boolean
  5936.  
  5937.             <DebuggerStepThrough>
  5938.             Get
  5939.                 Dim result As Boolean
  5940.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetBeep,
  5941.                                                                           0UI,
  5942.                                                                           result,
  5943.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5944.  
  5945.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5946.                 End If
  5947.  
  5948.                 Return result
  5949.             End Get
  5950.  
  5951.             <DebuggerStepThrough>
  5952.             Set(ByVal value As Boolean)
  5953.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetBeep,
  5954.                                                                           value,
  5955.                                                                           0UI,
  5956.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.UpdateIniFile) Then
  5957.  
  5958.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5959.                 End If
  5960.             End Set
  5961.  
  5962.         End Property
  5963.  
  5964.         ''' ----------------------------------------------------------------------------------------------------
  5965.         ''' <summary>
  5966.         ''' Gets or sets the number of times SetForegroundWindow will flash the taskbar button when rejecting a foreground switch request.
  5967.         ''' </summary>
  5968.         ''' ----------------------------------------------------------------------------------------------------
  5969.         ''' <value>
  5970.         ''' The number of times SetForegroundWindow will flash the taskbar button when rejecting a foreground switch request.
  5971.         ''' </value>
  5972.         ''' ----------------------------------------------------------------------------------------------------
  5973.         ''' <exception cref="Win32Exception">
  5974.         ''' </exception>
  5975.         '''
  5976.         ''' <exception cref="ArgumentException">
  5977.         ''' Value should be between 0 and 65535.;value
  5978.         ''' </exception>
  5979.         ''' ----------------------------------------------------------------------------------------------------
  5980.         Public Shared Property ForegroundFlashCount As UShort
  5981.  
  5982.             <DebuggerStepThrough>
  5983.             Get
  5984.                 Dim result As UShort
  5985.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetForegroundFlashCount,
  5986.                                                               0UI,
  5987.                                                               result,
  5988.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  5989.  
  5990.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  5991.                 End If
  5992.                 Return result
  5993.             End Get
  5994.  
  5995.             <DebuggerStepThrough>
  5996.             Set(ByVal value As UShort)
  5997.                 If (value < 0) OrElse (value > UShort.MaxValue) Then
  5998.                     Throw New ArgumentException(message:="Value should be between 0 and 65535.", paramName:="value")
  5999.  
  6000.                 Else
  6001.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetForegroundFlashCount,
  6002.                                                                               0I,
  6003.                                                                               CUInt(value),
  6004.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6005.  
  6006.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6007.                     End If
  6008.                 End If
  6009.             End Set
  6010.  
  6011.         End Property
  6012.  
  6013.         ''' ----------------------------------------------------------------------------------------------------
  6014.         ''' <summary>
  6015.         ''' Gets or sets the active window tracking delay, in milliseconds.
  6016.         ''' </summary>
  6017.         ''' ----------------------------------------------------------------------------------------------------
  6018.         ''' <value>
  6019.         ''' The active window tracking delay, in milliseconds.
  6020.         ''' </value>
  6021.         ''' ----------------------------------------------------------------------------------------------------
  6022.         ''' <exception cref="Win32Exception">
  6023.         ''' </exception>
  6024.         '''
  6025.         ''' <exception cref="ArgumentException">
  6026.         ''' Value should be between 0 and 65535.;value
  6027.         ''' </exception>
  6028.         ''' ----------------------------------------------------------------------------------------------------
  6029.         Public Shared Property ActiveWindowTrackingTimeout As UShort
  6030.  
  6031.             <DebuggerStepThrough>
  6032.             Get
  6033.                 Dim result As UShort
  6034.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetActiveWndTrkTimeout,
  6035.                                                               0UI,
  6036.                                                               result,
  6037.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  6038.  
  6039.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6040.                 End If
  6041.                 Return result
  6042.             End Get
  6043.  
  6044.             <DebuggerStepThrough>
  6045.             Set(ByVal value As UShort)
  6046.                 If (value < 0) OrElse (value > UShort.MaxValue) Then
  6047.                     Throw New ArgumentException(message:="Value should be between 0 and 65535.", paramName:="value")
  6048.  
  6049.                 Else
  6050.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetActiveWndTrkTimeout,
  6051.                                                                               0I,
  6052.                                                                               CUInt(value),
  6053.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6054.  
  6055.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6056.                     End If
  6057.                 End If
  6058.             End Set
  6059.  
  6060.         End Property
  6061.  
  6062.         ''' ----------------------------------------------------------------------------------------------------
  6063.         ''' <summary>
  6064.         ''' Gets or sets the amount of time following user input, in milliseconds,
  6065.         ''' during which the system will not allow applications to force themselves into the foreground.
  6066.         ''' </summary>
  6067.         ''' ----------------------------------------------------------------------------------------------------
  6068.         ''' <value>
  6069.         ''' The amount of time following user input, in milliseconds,
  6070.         ''' during which the system will not allow applications to force themselves into the foreground.
  6071.         ''' </value>
  6072.         ''' ----------------------------------------------------------------------------------------------------
  6073.         ''' <exception cref="Win32Exception">
  6074.         ''' </exception>
  6075.         '''
  6076.         ''' <exception cref="ArgumentException">
  6077.         ''' Value should be between 0 and 65535.;value
  6078.         ''' </exception>
  6079.         ''' ----------------------------------------------------------------------------------------------------
  6080.         Public Shared Property ForegroundLockTimeout As UShort
  6081.  
  6082.             <DebuggerStepThrough>
  6083.             Get
  6084.                 Dim result As UShort
  6085.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetForegroundLockTimeout,
  6086.                                                               0UI,
  6087.                                                               result,
  6088.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  6089.  
  6090.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6091.                 End If
  6092.                 Return result
  6093.             End Get
  6094.  
  6095.             <DebuggerStepThrough>
  6096.             Set(ByVal value As UShort)
  6097.                 If (value < 0) OrElse (value > UShort.MaxValue) Then
  6098.                     Throw New ArgumentException(message:="Value should be between 0 and 65535.", paramName:="value")
  6099.  
  6100.                 Else
  6101.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetForegroundLockTimeout,
  6102.                                                                               0I,
  6103.                                                                               CUInt(value),
  6104.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6105.  
  6106.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6107.                     End If
  6108.                 End If
  6109.             End Set
  6110.  
  6111.         End Property
  6112.  
  6113.         ''' ----------------------------------------------------------------------------------------------------
  6114.         ''' <summary>
  6115.         ''' Gets or sets the border multiplier factor that determines the width of a window's sizing border.
  6116.         ''' </summary>
  6117.         ''' ----------------------------------------------------------------------------------------------------
  6118.         ''' <value>
  6119.         ''' The border multiplier factor that determines the width of a window's sizing border.
  6120.         ''' </value>
  6121.         ''' ----------------------------------------------------------------------------------------------------
  6122.         ''' <exception cref="Win32Exception">
  6123.         ''' </exception>
  6124.         ''' ----------------------------------------------------------------------------------------------------
  6125.         Public Shared Property BorderMultiplierFactor As Integer
  6126.  
  6127.             <DebuggerStepThrough>
  6128.             Get
  6129.                 Return SystemInformation.BorderMultiplierFactor
  6130.             End Get
  6131.  
  6132.             <DebuggerStepThrough>
  6133.             Set(ByVal value As Integer)
  6134.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetBorder,
  6135.                                                                           value,
  6136.                                                                           0UI,
  6137.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6138.  
  6139.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6140.                 End If
  6141.             End Set
  6142.  
  6143.         End Property
  6144.  
  6145.         ''' ----------------------------------------------------------------------------------------------------
  6146.         ''' <summary>
  6147.         ''' Gets or sets the contrast value used in ClearType smoothing. From 1000 to 2200.
  6148.         ''' </summary>
  6149.         ''' ----------------------------------------------------------------------------------------------------
  6150.         ''' <value>
  6151.         ''' The contrast value used in ClearType smoothing. From 1000 to 2200.
  6152.         ''' </value>
  6153.         ''' ----------------------------------------------------------------------------------------------------
  6154.         ''' <exception cref="Win32Exception">
  6155.         ''' </exception>
  6156.         '''
  6157.         ''' <exception cref="ArgumentException">
  6158.         ''' Value should be between 1000 and 2200.;value
  6159.         ''' </exception>
  6160.         ''' ----------------------------------------------------------------------------------------------------
  6161.         Public Shared Property FontSmoothingContrast As Integer
  6162.  
  6163.             <DebuggerStepThrough>
  6164.             Get
  6165.                 Return SystemInformation.FontSmoothingContrast
  6166.             End Get
  6167.  
  6168.             <DebuggerStepThrough>
  6169.             Set(ByVal value As Integer)
  6170.                 If (value < 1000I) OrElse (value > 2200I) Then
  6171.                     Throw New ArgumentException(message:="Value should be between 1000 and 2200.", paramName:="value")
  6172.  
  6173.                 Else
  6174.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetFontSmoothingContrast,
  6175.                                                                               0UI,
  6176.                                                                               value,
  6177.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange Or
  6178.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.UpdateIniFile) Then
  6179.  
  6180.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6181.                     End If
  6182.                 End If
  6183.             End Set
  6184.  
  6185.         End Property
  6186.  
  6187.         ''' ----------------------------------------------------------------------------------------------------
  6188.         ''' <summary>
  6189.         ''' Gets or sets the time delay before the primary mouse button is locked.
  6190.         ''' </summary>
  6191.         ''' ----------------------------------------------------------------------------------------------------
  6192.         ''' <value>
  6193.         ''' The time delay before the primary mouse button is locked.
  6194.         ''' </value>
  6195.         ''' ----------------------------------------------------------------------------------------------------
  6196.         ''' <exception cref="Win32Exception">
  6197.         ''' </exception>
  6198.         '''
  6199.         ''' <exception cref="ArgumentException">
  6200.         ''' Value should be grater than -1.;value
  6201.         ''' </exception>
  6202.         ''' ----------------------------------------------------------------------------------------------------
  6203.         Public Shared Property MouseClickLockTime As Integer
  6204.  
  6205.             <DebuggerStepThrough>
  6206.             Get
  6207.                 Dim result As UInteger
  6208.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetMouseClickLockTime,
  6209.                                                               0UI,
  6210.                                                               result,
  6211.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6212.  
  6213.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6214.                 End If
  6215.                 Return CInt(result)
  6216.             End Get
  6217.  
  6218.             <DebuggerStepThrough>
  6219.             Set(ByVal value As Integer)
  6220.                 If (value < 0) Then
  6221.                     Throw New ArgumentException(message:="Value should be grater than -1.", paramName:="value")
  6222.  
  6223.                 Else
  6224.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseClickLockTime,
  6225.                                                                               0UI,
  6226.                                                                               value,
  6227.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6228.  
  6229.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6230.                     End If
  6231.                 End If
  6232.             End Set
  6233.  
  6234.         End Property
  6235.  
  6236.         ''' ----------------------------------------------------------------------------------------------------
  6237.         ''' <summary>
  6238.         ''' Gets or sets the width, in pixels, of the caret in edit controls.
  6239.         ''' </summary>
  6240.         ''' ----------------------------------------------------------------------------------------------------
  6241.         ''' <value>
  6242.         ''' The width, in pixels, of the caret in edit controls.
  6243.         ''' </value>
  6244.         ''' ----------------------------------------------------------------------------------------------------
  6245.         ''' <exception cref="Win32Exception">
  6246.         ''' </exception>
  6247.         '''
  6248.         ''' <exception cref="ArgumentException">
  6249.         ''' Value should be between 0 and 100.;value
  6250.         ''' </exception>
  6251.         ''' ----------------------------------------------------------------------------------------------------
  6252.         Public Shared Property CaretWidth As Integer
  6253.  
  6254.             <DebuggerStepThrough>
  6255.             Get
  6256.                 Return SystemInformation.CaretWidth
  6257.             End Get
  6258.  
  6259.             <DebuggerStepThrough>
  6260.             Set(ByVal value As Integer)
  6261.                 If (value < 0) OrElse (value > 100) Then
  6262.                     Throw New ArgumentException(message:="Value should be between 0 and 100.", paramName:="value")
  6263.  
  6264.                 Else
  6265.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetCaretWidth,
  6266.                                                                               0UI,
  6267.                                                                               value,
  6268.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6269.  
  6270.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6271.                     End If
  6272.                 End If
  6273.             End Set
  6274.  
  6275.         End Property
  6276.  
  6277.         ''' ----------------------------------------------------------------------------------------------------
  6278.         ''' <summary>
  6279.         ''' Gets or sets the current mouse speed. From 1 to 20.
  6280.         ''' </summary>
  6281.         ''' ----------------------------------------------------------------------------------------------------
  6282.         ''' <value>
  6283.         ''' The current mouse speed. From 1 to 20.
  6284.         ''' </value>
  6285.         ''' ----------------------------------------------------------------------------------------------------
  6286.         ''' <exception cref="Win32Exception">
  6287.         ''' </exception>
  6288.         '''
  6289.         ''' <exception cref="ArgumentException">
  6290.         ''' Value should be between 1 and 20.;value
  6291.         ''' </exception>
  6292.         ''' ----------------------------------------------------------------------------------------------------
  6293.         Public Shared Property MouseSpeed As Integer
  6294.  
  6295.             <DebuggerStepThrough>
  6296.             Get
  6297.                 Return SystemInformation.MouseSpeed
  6298.             End Get
  6299.  
  6300.             <DebuggerStepThrough>
  6301.             Set(ByVal value As Integer)
  6302.                 If (value < 1) OrElse (value > 20) Then
  6303.                     Throw New ArgumentException(message:="Value should be between 1 and 20.", paramName:="value")
  6304.  
  6305.                 Else
  6306.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseSpeed,
  6307.                                                                               0UI,
  6308.                                                                               value,
  6309.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6310.  
  6311.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6312.                     End If
  6313.                 End If
  6314.             End Set
  6315.  
  6316.         End Property
  6317.  
  6318.         ''' ----------------------------------------------------------------------------------------------------
  6319.         ''' <summary>
  6320.         ''' Gets or sets the time, in milliseconds, that the system waits before displaying a
  6321.         ''' cascaded shortcut menu when the mouse cursor is over a submenu item.
  6322.         ''' </summary>
  6323.         ''' ----------------------------------------------------------------------------------------------------
  6324.         ''' <value>
  6325.         ''' The time, in milliseconds, that the system waits before displaying a
  6326.         ''' cascaded shortcut menu when the mouse cursor is over a submenu item.
  6327.         ''' </value>
  6328.         ''' ----------------------------------------------------------------------------------------------------
  6329.         ''' <exception cref="Win32Exception">
  6330.         ''' </exception>
  6331.         '''
  6332.         ''' <exception cref="ArgumentException">
  6333.         ''' Value should be greater than 0.;value
  6334.         ''' </exception>
  6335.         ''' ----------------------------------------------------------------------------------------------------
  6336.         Public Shared Property MenuShowDelay As Integer
  6337.  
  6338.             <DebuggerStepThrough>
  6339.             Get
  6340.                 Return SystemInformation.MenuShowDelay
  6341.             End Get
  6342.  
  6343.             <DebuggerStepThrough>
  6344.             Set(ByVal value As Integer)
  6345.                 If (value < 0) Then
  6346.                     Throw New ArgumentException(message:="Value should be greater than -1.", paramName:="value")
  6347.  
  6348.                 Else
  6349.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMenuShowDelay,
  6350.                                                                               value,
  6351.                                                                               0UI,
  6352.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6353.  
  6354.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6355.                     End If
  6356.                 End If
  6357.             End Set
  6358.  
  6359.         End Property
  6360.  
  6361.         ''' ----------------------------------------------------------------------------------------------------
  6362.         ''' <summary>
  6363.         ''' Gets or sets the number of lines to scroll when the mouse wheel is rotated.
  6364.         ''' </summary>
  6365.         ''' ----------------------------------------------------------------------------------------------------
  6366.         ''' <value>
  6367.         ''' The number of lines to scroll when the mouse wheel is rotated.
  6368.         ''' </value>
  6369.         ''' ----------------------------------------------------------------------------------------------------
  6370.         ''' <exception cref="Win32Exception">
  6371.         ''' </exception>
  6372.         '''
  6373.         ''' <exception cref="ArgumentException">
  6374.         ''' Value should be greater than 0.;value
  6375.         ''' </exception>
  6376.         ''' ----------------------------------------------------------------------------------------------------
  6377.         Public Shared Property MouseWheelScrollLines As Integer
  6378.  
  6379.             <DebuggerStepThrough>
  6380.             Get
  6381.                 Return SystemInformation.MouseWheelScrollLines
  6382.             End Get
  6383.  
  6384.             <DebuggerStepThrough>
  6385.             Set(ByVal value As Integer)
  6386.                 If (value < 1) OrElse (value > Integer.MaxValue) Then
  6387.                     Throw New ArgumentException(message:="Value should be greater than 0.", paramName:="value")
  6388.  
  6389.                 Else
  6390.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetWheelScrollLines,
  6391.                                                                               value,
  6392.                                                                               0UI,
  6393.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6394.  
  6395.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6396.                     End If
  6397.                 End If
  6398.             End Set
  6399.  
  6400.         End Property
  6401.  
  6402.         ''' ----------------------------------------------------------------------------------------------------
  6403.         ''' <summary>
  6404.         ''' Gets or sets the time, in milliseconds, that the mouse pointer has to stay in the hover rectangle for TrackMouseEvent
  6405.         ''' to generate a WM_MOUSEHOVER message.
  6406.         ''' </summary>
  6407.         ''' ----------------------------------------------------------------------------------------------------
  6408.         ''' <value>
  6409.         ''' The time, in milliseconds, that the mouse pointer has to stay in the hover rectangle for TrackMouseEvent
  6410.         ''' to generate a WM_MOUSEHOVER message.
  6411.         ''' </value>
  6412.         ''' ----------------------------------------------------------------------------------------------------
  6413.         ''' <exception cref="Win32Exception">
  6414.         ''' </exception>
  6415.         '''
  6416.         ''' <exception cref="ArgumentException">
  6417.         ''' Value should be greater than 0.;value
  6418.         ''' </exception>
  6419.         ''' ----------------------------------------------------------------------------------------------------
  6420.         Public Shared Property MouseHoverTime As Integer
  6421.  
  6422.             <DebuggerStepThrough>
  6423.             Get
  6424.                 Return SystemInformation.MouseHoverTime
  6425.             End Get
  6426.  
  6427.             <DebuggerStepThrough>
  6428.             Set(ByVal value As Integer)
  6429.                 If (value < 1) OrElse (value > Integer.MaxValue) Then
  6430.                     Throw New ArgumentException(message:="Value should be greater than 0.", paramName:="value")
  6431.  
  6432.                 Else
  6433.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseHoverTime,
  6434.                                                                               value,
  6435.                                                                               0UI,
  6436.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6437.  
  6438.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6439.                     End If
  6440.                 End If
  6441.             End Set
  6442.  
  6443.         End Property
  6444.  
  6445.         ''' ----------------------------------------------------------------------------------------------------
  6446.         ''' <summary>
  6447.         ''' Gets or sets the number of cursors drawn when mouse trail feature is enabled.
  6448.         ''' </summary>
  6449.         ''' ----------------------------------------------------------------------------------------------------
  6450.         ''' <value>
  6451.         ''' The number of cursors drawn when mouse trail feature is enabled.
  6452.         ''' </value>
  6453.         ''' ----------------------------------------------------------------------------------------------------
  6454.         ''' <exception cref="Win32Exception">
  6455.         ''' </exception>
  6456.         '''
  6457.         ''' <exception cref="ArgumentException">
  6458.         ''' Value should be between 0 and 16.;value
  6459.         ''' </exception>
  6460.         ''' ----------------------------------------------------------------------------------------------------
  6461.         Public Shared Property MouseTrailAmount As Integer
  6462.  
  6463.             <DebuggerStepThrough>
  6464.             Get
  6465.                 Dim result As UInteger
  6466.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetMouseTrails,
  6467.                                                               0UI,
  6468.                                                               result,
  6469.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  6470.  
  6471.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6472.                 End If
  6473.                 Return CInt(result)
  6474.             End Get
  6475.  
  6476.             <DebuggerStepThrough>
  6477.             Set(ByVal value As Integer)
  6478.                 If (value < 0) OrElse (value > 16) Then
  6479.                     Throw New ArgumentException(message:="Value should be between 0 and 16.", paramName:="value")
  6480.  
  6481.                 Else
  6482.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseTrails,
  6483.                                                                               value,
  6484.                                                                               0UI,
  6485.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6486.  
  6487.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6488.                     End If
  6489.                 End If
  6490.             End Set
  6491.  
  6492.         End Property
  6493.  
  6494.         ''' ----------------------------------------------------------------------------------------------------
  6495.         ''' <summary>
  6496.         ''' Gets or sets the maximum number of milliseconds that can occur between the first and second clicks of a double-click.
  6497.         ''' </summary>
  6498.         ''' ----------------------------------------------------------------------------------------------------
  6499.         ''' <value>
  6500.         ''' The maximum number of milliseconds that can occur between the first and second clicks of a double-click.
  6501.         ''' </value>
  6502.         ''' ----------------------------------------------------------------------------------------------------
  6503.         ''' <exception cref="Win32Exception">
  6504.         ''' </exception>
  6505.         '''
  6506.         ''' <exception cref="ArgumentException">
  6507.         ''' Value should be greater thaan 0.;value
  6508.         ''' </exception>
  6509.         ''' ----------------------------------------------------------------------------------------------------
  6510.         Public Shared Property DoubleClickTime As Integer
  6511.  
  6512.             <DebuggerStepThrough>
  6513.             Get
  6514.                 Return SystemInformation.DoubleClickTime
  6515.             End Get
  6516.  
  6517.             <DebuggerStepThrough>
  6518.             Set(ByVal value As Integer)
  6519.                 If (value < 1) Then
  6520.                     Throw New ArgumentException(message:="Value should be greater than 0.", paramName:="value")
  6521.  
  6522.                 Else
  6523.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDoubleclickTime,
  6524.                                                                               value,
  6525.                                                                               0UI,
  6526.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6527.  
  6528.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6529.                     End If
  6530.                 End If
  6531.             End Set
  6532.  
  6533.         End Property
  6534.  
  6535.         ''' ----------------------------------------------------------------------------------------------------
  6536.         ''' <summary>
  6537.         ''' Gets or sets the keyboard repeat-delay. From 0 to 3.
  6538.         ''' Where zero sets the shortest delay (approximately 250 ms) and 3 sets the longest delay (approximately 1 second).
  6539.         ''' </summary>
  6540.         ''' ----------------------------------------------------------------------------------------------------
  6541.         ''' <value>
  6542.         ''' The keyboard repeat-delay, in seconds. From 0 to 3.
  6543.         ''' </value>
  6544.         ''' ----------------------------------------------------------------------------------------------------
  6545.         ''' <exception cref="Win32Exception">
  6546.         ''' </exception>
  6547.         '''
  6548.         ''' <exception cref="ArgumentException">
  6549.         ''' Value should be between 0 and 3.;value
  6550.         ''' </exception>
  6551.         ''' ----------------------------------------------------------------------------------------------------
  6552.         Public Shared Property KeyboardDelay As Integer
  6553.  
  6554.             <DebuggerStepThrough>
  6555.             Get
  6556.                 Return SystemInformation.KeyboardDelay
  6557.             End Get
  6558.  
  6559.             <DebuggerStepThrough>
  6560.             Set(ByVal value As Integer)
  6561.                 If (value < 0) OrElse (value > 3) Then
  6562.                     Throw New ArgumentException(message:="Value should be between 0 and 3.", paramName:="value")
  6563.  
  6564.                 Else
  6565.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetKeyboardDelay,
  6566.                                                                               CUInt(value),
  6567.                                                                               0UI,
  6568.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6569.  
  6570.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6571.                     End If
  6572.                 End If
  6573.             End Set
  6574.  
  6575.         End Property
  6576.  
  6577.         ''' ----------------------------------------------------------------------------------------------------
  6578.         ''' <summary>
  6579.         ''' Gets or sets the screen saver time-out, in seconds. From 1 to 599940.
  6580.         ''' </summary>
  6581.         ''' ----------------------------------------------------------------------------------------------------
  6582.         ''' <value>
  6583.         ''' The screen saver time-out, in seconds. From 1 to 599940.
  6584.         ''' </value>
  6585.         ''' ----------------------------------------------------------------------------------------------------
  6586.         ''' <exception cref="Win32Exception">
  6587.         ''' </exception>
  6588.         '''
  6589.         ''' <exception cref="ArgumentException">
  6590.         ''' Value should be between 1 and 599940.;value
  6591.         ''' </exception>
  6592.         ''' ----------------------------------------------------------------------------------------------------
  6593.         Public Shared Property ScreensaverTimeout As Integer
  6594.  
  6595.             <DebuggerStepThrough>
  6596.             Get
  6597.                 Dim result As UInteger
  6598.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetScreensaveTimeout,
  6599.                                                                           0UI,
  6600.                                                                           result,
  6601.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  6602.  
  6603.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6604.                 End If
  6605.                 Return CInt(result)
  6606.             End Get
  6607.  
  6608.             <DebuggerStepThrough>
  6609.             Set(ByVal value As Integer)
  6610.                 If (value < 1) OrElse (value > 599940) Then
  6611.                     Throw New ArgumentException(message:="Value should be between 1 and 599940.", paramName:="value")
  6612.  
  6613.                 Else
  6614.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetScreensaveTimeout,
  6615.                                                                               value,
  6616.                                                                               0UI,
  6617.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6618.  
  6619.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6620.                     End If
  6621.                 End If
  6622.             End Set
  6623.  
  6624.         End Property
  6625.  
  6626.         ''' ----------------------------------------------------------------------------------------------------
  6627.         ''' <summary>
  6628.         ''' Gets or sets the keyboard repeat-speed.
  6629.         ''' </summary>
  6630.         ''' ----------------------------------------------------------------------------------------------------
  6631.         ''' <value>
  6632.         ''' The keyboard repeat-speed, from 0 to 31.
  6633.         ''' </value>
  6634.         ''' ----------------------------------------------------------------------------------------------------
  6635.         ''' <exception cref="Win32Exception">
  6636.         ''' </exception>
  6637.         '''
  6638.         ''' <exception cref="ArgumentException">
  6639.         ''' Value should be between 0 and 31.;value
  6640.         ''' </exception>
  6641.         ''' ----------------------------------------------------------------------------------------------------
  6642.         Public Shared Property KeyboardSpeed As Integer
  6643.  
  6644.             <DebuggerStepThrough>
  6645.             Get
  6646.                 Return SystemInformation.KeyboardSpeed
  6647.             End Get
  6648.  
  6649.             <DebuggerStepThrough>
  6650.             Set(ByVal value As Integer)
  6651.                 If (value < 0) OrElse (value > 31) Then
  6652.                     Throw New ArgumentException(message:="Value should be between 0 and 31.", paramName:="value")
  6653.  
  6654.                 Else
  6655.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetKeyboardSpeed,
  6656.                                                                               CUInt(value),
  6657.                                                                               0UI,
  6658.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6659.  
  6660.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6661.                     End If
  6662.                 End If
  6663.             End Set
  6664.  
  6665.         End Property
  6666.  
  6667.         ''' ----------------------------------------------------------------------------------------------------
  6668.         ''' <summary>
  6669.         ''' Gets or sets the time that notification pop-ups should be displayed, in seconds.
  6670.         ''' </summary>
  6671.         ''' ----------------------------------------------------------------------------------------------------
  6672.         ''' <value>
  6673.         ''' The time that notification pop-ups should be displayed, in seconds.
  6674.         ''' </value>
  6675.         ''' ----------------------------------------------------------------------------------------------------
  6676.         ''' <exception cref="Win32Exception">
  6677.         ''' </exception>
  6678.         ''' ----------------------------------------------------------------------------------------------------
  6679.         Public Shared Property MessageDuration As Long
  6680.  
  6681.             <DebuggerStepThrough>
  6682.             Get
  6683.                 Dim result As ULong
  6684.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetMessageDuration,
  6685.                                                                0UI,
  6686.                                                                result,
  6687.                                                                EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  6688.  
  6689.                     ' Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6690.                 End If
  6691.                 Return CLng(result)
  6692.             End Get
  6693.  
  6694.             <DebuggerStepThrough>
  6695.             Set(ByVal value As Long)
  6696.                 If (value < 5) OrElse (value > 4294967295) Then
  6697.                     Throw New ArgumentException(message:="Value should be between 5 and 4294967295.", paramName:="value")
  6698.  
  6699.                 Else
  6700.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMessageDuration,
  6701.                                                                               0UI,
  6702.                                                                               value,
  6703.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6704.  
  6705.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6706.                     End If
  6707.                 End If
  6708.             End Set
  6709.  
  6710.         End Property
  6711.  
  6712.         ''' ----------------------------------------------------------------------------------------------------
  6713.         ''' <summary>
  6714.         ''' Gets or sets the width and height, in pixels, of the focus rectangle drawn with DrawFocusRect.
  6715.         ''' </summary>
  6716.         ''' ----------------------------------------------------------------------------------------------------
  6717.         ''' <value>
  6718.         ''' The width and height, in pixels, of the focus rectangle drawn with DrawFocusRect.
  6719.         ''' </value>
  6720.         ''' ----------------------------------------------------------------------------------------------------
  6721.         ''' <exception cref="Win32Exception">
  6722.         ''' </exception>
  6723.         '''
  6724.         ''' <exception cref="ArgumentException">
  6725.         ''' Width should be greater than 0.;value
  6726.         ''' </exception>
  6727.         '''
  6728.         ''' <exception cref="ArgumentException">
  6729.         ''' Height should be greater than 0.;value
  6730.         ''' </exception>
  6731.         ''' ----------------------------------------------------------------------------------------------------
  6732.         Public Shared Property FocusBorderSize As Size
  6733.  
  6734.             <DebuggerStepThrough>
  6735.             Get
  6736.                 Dim width As UInteger
  6737.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetFocusBorderWidth,
  6738.                                                               0UI,
  6739.                                                               width,
  6740.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  6741.  
  6742.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6743.                 End If
  6744.  
  6745.                 Dim height As UInteger
  6746.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetFocusBorderHeight,
  6747.                                                               0UI,
  6748.                                                               height,
  6749.                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  6750.  
  6751.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6752.                 End If
  6753.                 Return New Size(CInt(width), CInt(height))
  6754.  
  6755.             End Get
  6756.  
  6757.             <DebuggerStepThrough>
  6758.             Set(ByVal value As Size)
  6759.                 If (value.Width < 1) Then
  6760.                     Throw New ArgumentException(message:="Width should be greater than 0.", paramName:="value")
  6761.  
  6762.                 ElseIf (value.Height < 1) Then
  6763.                     Throw New ArgumentException(message:="Height should be greater than 0.", paramName:="value")
  6764.  
  6765.                 Else
  6766.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetFocusBorderWidth,
  6767.                                                                               0UI,
  6768.                                                                               value.Width,
  6769.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6770.  
  6771.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6772.                     End If
  6773.  
  6774.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetFocusBorderHeight,
  6775.                                                                               0UI,
  6776.                                                                               value.Height,
  6777.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6778.  
  6779.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6780.                     End If
  6781.  
  6782.                 End If
  6783.             End Set
  6784.  
  6785.         End Property
  6786.  
  6787.         ''' ----------------------------------------------------------------------------------------------------
  6788.         ''' <summary>
  6789.         ''' Gets or sets the width and height, in pixels, of the rectangle which the mouse pointer has to stay for TrackMouseEvent
  6790.         ''' to generate a WM_MOUSEHOVER message.
  6791.         ''' </summary>
  6792.         ''' ----------------------------------------------------------------------------------------------------
  6793.         ''' <value>
  6794.         ''' The width and height, in pixels, of the rectangle which the mouse pointer has to stay for TrackMouseEvent
  6795.         ''' to generate a WM_MOUSEHOVER message.
  6796.         ''' </value>
  6797.         ''' ----------------------------------------------------------------------------------------------------
  6798.         ''' <exception cref="Win32Exception">
  6799.         ''' </exception>
  6800.         '''
  6801.         ''' <exception cref="ArgumentException">
  6802.         ''' Width should be greater than 0.;value
  6803.         ''' </exception>
  6804.         '''
  6805.         ''' <exception cref="ArgumentException">
  6806.         ''' Height should be greater than 0.;value
  6807.         ''' </exception>
  6808.         ''' ----------------------------------------------------------------------------------------------------
  6809.         Public Shared Property MouseHoverSize As Size
  6810.  
  6811.             <DebuggerStepThrough>
  6812.             Get
  6813.                 Return SystemInformation.MouseHoverSize
  6814.             End Get
  6815.  
  6816.             <DebuggerStepThrough>
  6817.             Set(ByVal value As Size)
  6818.                 If (value.Width < 1) Then
  6819.                     Throw New ArgumentException(message:="Width should be greater than 0", paramName:="value")
  6820.  
  6821.                 ElseIf (value.Height < 1) Then
  6822.                     Throw New ArgumentException(message:="Height should be greater than 0.", paramName:="value")
  6823.  
  6824.                 Else
  6825.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseHoverWidth,
  6826.                                                                               value.Width,
  6827.                                                                               0UI,
  6828.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6829.  
  6830.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6831.                     End If
  6832.  
  6833.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMouseHoverHeight,
  6834.                                                                               value.Height,
  6835.                                                                               0UI,
  6836.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6837.  
  6838.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6839.                     End If
  6840.  
  6841.                 End If
  6842.             End Set
  6843.  
  6844.         End Property
  6845.  
  6846.         ''' ----------------------------------------------------------------------------------------------------
  6847.         ''' <summary>
  6848.         ''' Gets or sets the width and height, in pixels, of the rectangle used to detect the start of a drag operation.
  6849.         ''' </summary>
  6850.         ''' ----------------------------------------------------------------------------------------------------
  6851.         ''' <value>
  6852.         ''' The width and height, in pixels, of the rectangle used to detect the start of a drag operation.
  6853.         ''' </value>
  6854.         ''' ----------------------------------------------------------------------------------------------------
  6855.         ''' <exception cref="Win32Exception">
  6856.         ''' </exception>
  6857.         '''
  6858.         ''' <exception cref="ArgumentException">
  6859.         ''' Width should be greater than 0.;value
  6860.         ''' </exception>
  6861.         '''
  6862.         ''' <exception cref="ArgumentException">
  6863.         ''' Height should be greater than 0.;value
  6864.         ''' </exception>
  6865.         ''' ----------------------------------------------------------------------------------------------------
  6866.         Public Shared Property DragSize As Size
  6867.  
  6868.             <DebuggerStepThrough>
  6869.             Get
  6870.                 Return SystemInformation.DragSize
  6871.             End Get
  6872.  
  6873.             <DebuggerStepThrough>
  6874.             Set(ByVal value As Size)
  6875.                 If (value.Width < 1) Then
  6876.                     Throw New ArgumentException(message:="Width should be greater than 0.", paramName:="value")
  6877.  
  6878.                 ElseIf (value.Height < 1) Then
  6879.                     Throw New ArgumentException(message:="Height should be greater than 0.", paramName:="value")
  6880.  
  6881.                 Else
  6882.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDragWidth,
  6883.                                                                               value.Width,
  6884.                                                                               0UI,
  6885.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6886.  
  6887.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6888.                     End If
  6889.  
  6890.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDragHeight,
  6891.                                                                               value.Height,
  6892.                                                                               0UI,
  6893.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6894.  
  6895.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6896.                     End If
  6897.  
  6898.                 End If
  6899.             End Set
  6900.  
  6901.         End Property
  6902.  
  6903.         ''' ----------------------------------------------------------------------------------------------------
  6904.         ''' <summary>
  6905.         ''' Gets or sets the width and height, in pixels, of the double-click rectangle which
  6906.         ''' the second click of a double-click must fall for it to be registered as a double-click.
  6907.         ''' </summary>
  6908.         ''' ----------------------------------------------------------------------------------------------------
  6909.         ''' <value>
  6910.         ''' The width and height, in pixels, of the double-click rectangle which
  6911.         ''' the second click of a double-click must fall for it to be registered as a double-click.
  6912.         ''' </value>
  6913.         ''' ----------------------------------------------------------------------------------------------------
  6914.         ''' <exception cref="Win32Exception">
  6915.         ''' </exception>
  6916.         '''
  6917.         ''' <exception cref="ArgumentException">
  6918.         ''' Width should be greater than 31.;value
  6919.         ''' </exception>
  6920.         '''
  6921.         ''' <exception cref="ArgumentException">
  6922.         ''' Height should be greater than 31.;value
  6923.         ''' </exception>
  6924.         ''' ----------------------------------------------------------------------------------------------------
  6925.         Public Shared Property DoubleClickSize As Size
  6926.  
  6927.             <DebuggerStepThrough>
  6928.             Get
  6929.                 Return SystemInformation.DoubleClickSize
  6930.             End Get
  6931.  
  6932.             <DebuggerStepThrough>
  6933.             Set(ByVal value As Size)
  6934.                 If (value.Width < 32) Then
  6935.                     Throw New ArgumentException(message:="Width should be greater than 31.", paramName:="value")
  6936.  
  6937.                 ElseIf (value.Height < 32) Then
  6938.                     Throw New ArgumentException(message:="Height should be greater than 31.", paramName:="value")
  6939.  
  6940.                 Else
  6941.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDoubleClickWidth,
  6942.                                                                               value.Width,
  6943.                                                                               0UI,
  6944.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6945.  
  6946.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6947.                     End If
  6948.  
  6949.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDoubleClickHeight,
  6950.                                                                               value.Height,
  6951.                                                                               0UI,
  6952.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  6953.  
  6954.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  6955.                     End If
  6956.  
  6957.                 End If
  6958.             End Set
  6959.  
  6960.         End Property
  6961.  
  6962.         ''' ----------------------------------------------------------------------------------------------------
  6963.         ''' <summary>
  6964.         ''' Gets or sets the width and height, in pixels, of an icon cell.
  6965.         ''' </summary>
  6966.         ''' ----------------------------------------------------------------------------------------------------
  6967.         ''' <value>
  6968.         ''' The width and height, in pixels, of an icon cell.
  6969.         ''' </value>
  6970.         ''' ----------------------------------------------------------------------------------------------------
  6971.         ''' <exception cref="Win32Exception">
  6972.         ''' </exception>
  6973.         '''
  6974.         ''' <exception cref="ArgumentException">
  6975.         ''' Width should be greater than 31.;value
  6976.         ''' </exception>
  6977.         '''
  6978.         ''' <exception cref="ArgumentException">
  6979.         ''' Height should be greater than 31.;value
  6980.         ''' </exception>
  6981.         ''' ----------------------------------------------------------------------------------------------------
  6982.         Public Shared Property IconSpacing As Size
  6983.  
  6984.             <DebuggerStepThrough>
  6985.             Get
  6986.                 Return SystemInformation.IconSpacingSize
  6987.             End Get
  6988.  
  6989.             <DebuggerStepThrough>
  6990.             Set(ByVal value As Size)
  6991.                 If (value.Width < 32) Then
  6992.                     Throw New ArgumentException(message:="Width should be greater than 31.", paramName:="value")
  6993.  
  6994.                 ElseIf (value.Height < 32) Then
  6995.                     Throw New ArgumentException(message:="Height should be greater than 31.", paramName:="value")
  6996.  
  6997.                 Else
  6998.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.IconHorizontalSpacing,
  6999.                                                                               value.Width,
  7000.                                                                               0UI,
  7001.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  7002.  
  7003.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  7004.                     End If
  7005.  
  7006.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.IconVerticalSpacing,
  7007.                                                                               value.Height,
  7008.                                                                               0UI,
  7009.                                                                               EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  7010.  
  7011.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  7012.                     End If
  7013.  
  7014.                 End If
  7015.             End Set
  7016.  
  7017.         End Property
  7018.  
  7019.         ''' ----------------------------------------------------------------------------------------------------
  7020.         ''' <summary>
  7021.         ''' Gets or sets the side of pop-up menus that are aligned to the corresponding menu-bar item.
  7022.         ''' </summary>
  7023.         ''' ----------------------------------------------------------------------------------------------------
  7024.         ''' <value>
  7025.         ''' The side of pop-up menus that are aligned to the corresponding menu-bar item.
  7026.         ''' </value>
  7027.         ''' ----------------------------------------------------------------------------------------------------
  7028.         ''' <exception cref="Win32Exception">
  7029.         ''' </exception>
  7030.         ''' ----------------------------------------------------------------------------------------------------
  7031.         Public Shared Property PopupMenuAlignment As LeftRightAlignment
  7032.  
  7033.             <DebuggerStepThrough>
  7034.             Get
  7035.                 Return SystemInformation.PopupMenuAlignment
  7036.             End Get
  7037.  
  7038.             <DebuggerStepThrough>
  7039.             Set(ByVal value As LeftRightAlignment)
  7040.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetMenuDropAlignment,
  7041.                                                                           CBool(value),
  7042.                                                                           0UI,
  7043.                                                                           EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  7044.  
  7045.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  7046.                 End If
  7047.             End Set
  7048.  
  7049.         End Property
  7050.  
  7051.         ''' ----------------------------------------------------------------------------------------------------
  7052.         ''' <example>
  7053.         ''' Dim dateAndTime As New Date(year:=2000, month:=1, day:=1,
  7054.         '''                             hour:=0, minute:=0, second:=0)
  7055.         '''
  7056.         ''' Dim dateOnly As New Date(year:=2000, month:=1, day:=1,
  7057.         '''                          hour:=Date.Now.Hour, minute:=Date.Now.Minute, second:=Date.Now.Second)
  7058.         '''
  7059.         ''' Dim timeOnly As New Date(year:=Date.Today.Year, month:=Date.Today.Month, day:=Date.Today.Day,
  7060.         '''                          hour:=0, minute:=0, second:=0)
  7061.         '''
  7062.         ''' </example>
  7063.         ''' ----------------------------------------------------------------------------------------------------
  7064.         ''' <summary>
  7065.         ''' Gets or sets the system date and time.
  7066.         ''' </summary>
  7067.         ''' ----------------------------------------------------------------------------------------------------
  7068.         ''' <value>
  7069.         ''' The system date and time.
  7070.         ''' </value>
  7071.         ''' ----------------------------------------------------------------------------------------------------
  7072.         Public Shared Property SystemDateTime() As Date
  7073.             <DebuggerStepThrough>
  7074.             Get
  7075.                 Return DateTime.Now
  7076.             End Get
  7077.             <DebuggerStepThrough>
  7078.             Set(ByVal value As Date)
  7079.  
  7080.                 If value.Second = 0 Then
  7081.                     value.AddSeconds(1)
  7082.                 End If
  7083.  
  7084.                 ' Set the System Hour.
  7085.                 Microsoft.VisualBasic.TimeOfDay = value
  7086.  
  7087.                 ' Set the System Date.
  7088.                 Microsoft.VisualBasic.DateString = value.ToString("MM/dd/yyyy")
  7089.  
  7090.             End Set
  7091.         End Property
  7092.  
  7093. #End Region
  7094.  
  7095. #Region " Enumerations "
  7096.  
  7097.         ''' ----------------------------------------------------------------------------------------------------
  7098.         ''' <summary>
  7099.         ''' Indicates the possible processor architectures.
  7100.         ''' </summary>
  7101.         ''' ----------------------------------------------------------------------------------------------------
  7102.         Public Enum Architecture As Integer
  7103.  
  7104.             ''' <summary>
  7105.             ''' 32-Bit
  7106.             ''' </summary>
  7107.             X86 = 32
  7108.  
  7109.             ''' <summary>
  7110.             ''' 64-Bit
  7111.             ''' </summary>
  7112.             X64 = 64
  7113.  
  7114.         End Enum
  7115.  
  7116. #End Region
  7117.  
  7118. #Region " Constructors "
  7119.  
  7120.         ''' ----------------------------------------------------------------------------------------------------
  7121.         ''' <summary>
  7122.         ''' Prevents a default instance of the <see cref="OS"/> class from being created.
  7123.         ''' </summary>
  7124.         ''' ----------------------------------------------------------------------------------------------------
  7125.         <DebuggerStepThrough>
  7126.         Private Sub New()
  7127.         End Sub
  7128.  
  7129. #End Region
  7130.  
  7131. #Region " Public Methods "
  7132.  
  7133.         ''' ----------------------------------------------------------------------------------------------------
  7134.         ''' <summary>
  7135.         ''' Notifies the system to update after a registry change.
  7136.         ''' </summary>
  7137.         ''' ----------------------------------------------------------------------------------------------------
  7138.         ''' <param name="keyName">
  7139.         ''' A string that indicates the area containing the system parameter that was changed.
  7140.         '''
  7141.         ''' This string can be the name of a registry key or the name of a section in the Win.ini file.
  7142.         '''
  7143.         ''' When the string is a registry name, it typically indicates only the leaf node in the registry, not the full path.
  7144.         '''
  7145.         ''' To effect a change in the policy settings, this parameter points to the string "Policy".
  7146.         ''' To effect a change in the locale settings, this parameter points to the string "intl".
  7147.         ''' To effect a change in the environment variables for the system or the user, this parameter points to the string "Environment".
  7148.         ''' </param>
  7149.         ''' ----------------------------------------------------------------------------------------------------
  7150.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/ms725497%28v=vs.85%29.aspx</remarks>
  7151.         ''' ----------------------------------------------------------------------------------------------------
  7152.         <DebuggerStepThrough>
  7153.         Public Shared Sub NotifyRegistryChange(ByVal keyName As String)
  7154.  
  7155.             EnvironmentUtil.NativeMethods.SendMessageTimeout(New IntPtr(EnvironmentUtil.NativeMethods.WindowsMessages.HWND_BROADCAST),
  7156.                                                              CInt(EnvironmentUtil.NativeMethods.WindowsMessages.WM_SETTINGCHANGE),
  7157.                                                              New IntPtr(0),
  7158.                                                              keyName,
  7159.                                                              EnvironmentUtil.NativeMethods.SendMessageTimeoutFlags.AbortIfHung,
  7160.                                                              1,
  7161.                                                              IntPtr.Zero)
  7162.  
  7163.         End Sub
  7164.  
  7165.         ''' ----------------------------------------------------------------------------------------------------
  7166.         ''' <summary>
  7167.         ''' Reloads the system cursors.
  7168.         ''' </summary>
  7169.         ''' ----------------------------------------------------------------------------------------------------
  7170.         ''' <exception cref="Win32Exception">
  7171.         ''' </exception>
  7172.         ''' ----------------------------------------------------------------------------------------------------
  7173.         <DebuggerStepThrough>
  7174.         Public Shared Sub ReloadSystemCursors()
  7175.  
  7176.             If EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.Setcursors,
  7177.                                                                       0UI,
  7178.                                                                       0UI,
  7179.                                                                       EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  7180.  
  7181.                 Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  7182.             End If
  7183.  
  7184.         End Sub
  7185.  
  7186.         ''' ----------------------------------------------------------------------------------------------------
  7187.         ''' <summary>
  7188.         ''' Reloads the system icons.
  7189.         ''' </summary>
  7190.         ''' ----------------------------------------------------------------------------------------------------
  7191.         ''' <exception cref="Win32Exception">
  7192.         ''' </exception>
  7193.         ''' ----------------------------------------------------------------------------------------------------
  7194.         <DebuggerStepThrough>
  7195.         Public Shared Sub ReloadSystemIcons()
  7196.  
  7197.             If EnvironmentUtil.NativeMethods.SystemParametersInfo(EnvironmentUtil.NativeMethods.SystemParametersActionFlags.Seticons,
  7198.                                                                       0UI,
  7199.                                                                       0UI,
  7200.                                                                       EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.SendWinIniChange) Then
  7201.  
  7202.                 Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  7203.             End If
  7204.  
  7205.         End Sub
  7206.  
  7207.         ''' ----------------------------------------------------------------------------------------------------
  7208.         ''' <summary>
  7209.         ''' Notifies the system that a directory has been created.
  7210.         ''' </summary>
  7211.         ''' ----------------------------------------------------------------------------------------------------
  7212.         ''' <param name="directoryPath">
  7213.         ''' The full path of the directory that has been created.
  7214.         ''' </param>
  7215.         ''' ----------------------------------------------------------------------------------------------------
  7216.         ''' <exception cref="ArgumentNullException">
  7217.         ''' directoryPath
  7218.         ''' </exception>
  7219.         ''' ----------------------------------------------------------------------------------------------------
  7220.         <DebuggerStepThrough>
  7221.         Public Shared Sub NotifyDirectoryCreated(ByVal directoryPath As String)
  7222.  
  7223.             If String.IsNullOrWhiteSpace(directoryPath) Then
  7224.                 Throw New ArgumentNullException(paramName:="directoryPath")
  7225.  
  7226.             Else
  7227.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DirectoryCreated,
  7228.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7229.                                                              dwItem1:=directoryPath, dwItem2:=Nothing)
  7230.             End If
  7231.  
  7232.         End Sub
  7233.  
  7234.         ''' ----------------------------------------------------------------------------------------------------
  7235.         ''' <summary>
  7236.         ''' Notifies the system that a directory has been deleted.
  7237.         ''' </summary>
  7238.         ''' ----------------------------------------------------------------------------------------------------
  7239.         ''' <param name="directoryPath">
  7240.         ''' The full path of the directory that has been deleted.
  7241.         ''' </param>
  7242.         ''' ----------------------------------------------------------------------------------------------------
  7243.         ''' <exception cref="ArgumentNullException">
  7244.         ''' directoryPath
  7245.         ''' </exception>
  7246.         ''' ----------------------------------------------------------------------------------------------------
  7247.         <DebuggerStepThrough>
  7248.         Public Shared Sub NotifyDirectoryDeleted(ByVal directoryPath As String)
  7249.  
  7250.             If String.IsNullOrWhiteSpace(directoryPath) Then
  7251.                 Throw New ArgumentNullException(paramName:="directoryPath")
  7252.  
  7253.             Else
  7254.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DirectoryDeleted,
  7255.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7256.                                                              dwItem1:=directoryPath, dwItem2:=Nothing)
  7257.             End If
  7258.  
  7259.         End Sub
  7260.  
  7261.         ''' ----------------------------------------------------------------------------------------------------
  7262.         ''' <summary>
  7263.         ''' Notifies the system that a directory has been renamed.
  7264.         ''' </summary>
  7265.         ''' ----------------------------------------------------------------------------------------------------
  7266.         ''' <param name="oldDirectoryPath">
  7267.         ''' The previous full path of the directory that has been renamed.
  7268.         ''' </param>
  7269.         '''
  7270.         ''' <param name="newDirectoryPath">
  7271.         ''' The new full path of the directory that has been renamed.
  7272.         ''' </param>
  7273.         ''' ----------------------------------------------------------------------------------------------------
  7274.         ''' <exception cref="ArgumentNullException">
  7275.         ''' oldDirectoryPath or newDirectoryPath
  7276.         ''' </exception>
  7277.         ''' ----------------------------------------------------------------------------------------------------
  7278.         <DebuggerStepThrough>
  7279.         Public Shared Sub NotifyDirectoryRenamed(ByVal oldDirectoryPath As String,
  7280.                                                  ByVal newDirectoryPath As String)
  7281.  
  7282.             If String.IsNullOrWhiteSpace(oldDirectoryPath) Then
  7283.                 Throw New ArgumentNullException(paramName:="oldDirectoryPath")
  7284.  
  7285.             ElseIf String.IsNullOrWhiteSpace(newDirectoryPath) Then
  7286.                 Throw New ArgumentNullException(paramName:="newDirectoryPath")
  7287.  
  7288.             Else
  7289.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DirectoryRenamed,
  7290.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7291.                                                              dwItem1:=oldDirectoryPath, dwItem2:=newDirectoryPath)
  7292.             End If
  7293.  
  7294.         End Sub
  7295.  
  7296.         ''' ----------------------------------------------------------------------------------------------------
  7297.         ''' <summary>
  7298.         ''' Notifies the system that a file has been created.
  7299.         ''' </summary>
  7300.         ''' ----------------------------------------------------------------------------------------------------
  7301.         ''' <param name="filePath">
  7302.         ''' The full path of the file that has been created.
  7303.         ''' </param>
  7304.         ''' ----------------------------------------------------------------------------------------------------
  7305.         ''' <exception cref="ArgumentNullException">
  7306.         ''' filePath
  7307.         ''' </exception>
  7308.         ''' ----------------------------------------------------------------------------------------------------
  7309.         <DebuggerStepThrough>
  7310.         Public Shared Sub NotifyFileCreated(ByVal filePath As String)
  7311.  
  7312.             If String.IsNullOrWhiteSpace(filePath) Then
  7313.                 Throw New ArgumentNullException(paramName:="filePath")
  7314.  
  7315.             Else
  7316.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.ItemCreated,
  7317.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7318.                                                              dwItem1:=filePath, dwItem2:=Nothing)
  7319.             End If
  7320.  
  7321.         End Sub
  7322.  
  7323.         ''' ----------------------------------------------------------------------------------------------------
  7324.         ''' <summary>
  7325.         ''' Notifies the system that a file has been deleted.
  7326.         ''' </summary>
  7327.         ''' ----------------------------------------------------------------------------------------------------
  7328.         ''' <param name="filePath">
  7329.         ''' The full path of the file that has been deleted.
  7330.         ''' </param>
  7331.         ''' ----------------------------------------------------------------------------------------------------
  7332.         ''' <exception cref="ArgumentNullException">
  7333.         ''' filePath
  7334.         ''' </exception>
  7335.         ''' ----------------------------------------------------------------------------------------------------
  7336.         <DebuggerStepThrough>
  7337.         Public Shared Sub NotifyFileDeleted(ByVal filePath As String)
  7338.  
  7339.             If String.IsNullOrWhiteSpace(filePath) Then
  7340.                 Throw New ArgumentNullException(paramName:="filePath")
  7341.  
  7342.             Else
  7343.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.ItemDeleted,
  7344.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7345.                                                              dwItem1:=filePath, dwItem2:=Nothing)
  7346.             End If
  7347.  
  7348.         End Sub
  7349.  
  7350.         ''' ----------------------------------------------------------------------------------------------------
  7351.         ''' <summary>
  7352.         ''' Notifies the system that a file has been renamed.
  7353.         ''' </summary>
  7354.         ''' ----------------------------------------------------------------------------------------------------
  7355.         ''' <param name="oldFilePath">
  7356.         ''' The previous full path of the file that has been renamed.
  7357.         ''' </param>
  7358.         '''
  7359.         ''' <param name="newFilePath">
  7360.         ''' The new full path of the file that has been renamed.
  7361.         ''' </param>
  7362.         ''' ----------------------------------------------------------------------------------------------------
  7363.         ''' <exception cref="ArgumentNullException">
  7364.         ''' oldFilePath or newFilePath
  7365.         ''' </exception>
  7366.         ''' ----------------------------------------------------------------------------------------------------
  7367.         <DebuggerStepThrough>
  7368.         Public Shared Sub NotifyFileRenamed(ByVal oldFilePath As String,
  7369.                                             ByVal newFilePath As String)
  7370.  
  7371.             If String.IsNullOrWhiteSpace(oldFilePath) Then
  7372.                 Throw New ArgumentNullException(paramName:="oldFilePath")
  7373.  
  7374.             ElseIf String.IsNullOrWhiteSpace(newFilePath) Then
  7375.                 Throw New ArgumentNullException(paramName:="newFilePath")
  7376.  
  7377.             Else
  7378.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.ItemRenamed,
  7379.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7380.                                                              dwItem1:=oldFilePath, dwItem2:=newFilePath)
  7381.             End If
  7382.  
  7383.         End Sub
  7384.  
  7385.         ''' ----------------------------------------------------------------------------------------------------
  7386.         ''' <summary>
  7387.         ''' Notifies the system that a drive has been added.
  7388.         ''' </summary>
  7389.         ''' ----------------------------------------------------------------------------------------------------
  7390.         ''' <param name="driveRootPath">
  7391.         ''' The root path of the drive that has been added.
  7392.         ''' </param>
  7393.         '''
  7394.         ''' <param name="createShellWindow">
  7395.         ''' If <c>True</c>, tell the Shell to create a new window for the drive.
  7396.         ''' </param>
  7397.         ''' ----------------------------------------------------------------------------------------------------
  7398.         ''' <exception cref="ArgumentNullException">
  7399.         ''' driveRootPath
  7400.         ''' </exception>
  7401.         ''' ----------------------------------------------------------------------------------------------------
  7402.         <DebuggerStepThrough>
  7403.         Public Shared Sub NotifyDriveAdded(ByVal driveRootPath As String,
  7404.                                            Optional ByVal createShellWindow As Boolean = False)
  7405.  
  7406.             If String.IsNullOrWhiteSpace(driveRootPath) Then
  7407.                 Throw New ArgumentNullException(paramName:="driveRootPath")
  7408.  
  7409.             Else
  7410.                 Select Case createShellWindow
  7411.  
  7412.                     Case True
  7413.                         EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DriveAddedShell,
  7414.                                                                      EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7415.                                                                      dwItem1:=driveRootPath, dwItem2:=Nothing)
  7416.                     Case Else
  7417.                         EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DriveAdded,
  7418.                                                                      EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7419.                                                                      dwItem1:=driveRootPath, dwItem2:=Nothing)
  7420.  
  7421.                 End Select
  7422.  
  7423.             End If
  7424.  
  7425.         End Sub
  7426.  
  7427.         ''' ----------------------------------------------------------------------------------------------------
  7428.         ''' <summary>
  7429.         ''' Notifies the system that a drive has been removed.
  7430.         ''' </summary>
  7431.         ''' ----------------------------------------------------------------------------------------------------
  7432.         ''' <param name="driveRootPath">
  7433.         ''' The root path of the drive that has been removed.
  7434.         ''' </param>
  7435.         ''' ----------------------------------------------------------------------------------------------------
  7436.         ''' <exception cref="ArgumentNullException">
  7437.         ''' driveRootPath
  7438.         ''' </exception>
  7439.         ''' ----------------------------------------------------------------------------------------------------
  7440.         <DebuggerStepThrough>
  7441.         Public Shared Sub NotifyDriveRemoved(ByVal driveRootPath As String)
  7442.  
  7443.             If String.IsNullOrWhiteSpace(driveRootPath) Then
  7444.                 Throw New ArgumentNullException(paramName:="driveRootPath")
  7445.  
  7446.             Else
  7447.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.DriveRemoved,
  7448.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7449.                                                              dwItem1:=driveRootPath, dwItem2:=Nothing)
  7450.             End If
  7451.  
  7452.         End Sub
  7453.  
  7454.         ''' ----------------------------------------------------------------------------------------------------
  7455.         ''' <summary>
  7456.         ''' Notifies the system that a storage media has been inserted into a drive.
  7457.         ''' </summary>
  7458.         ''' ----------------------------------------------------------------------------------------------------
  7459.         ''' <param name="driveRootPath">
  7460.         ''' The root path of the drive that contains the new media.
  7461.         ''' </param>
  7462.         ''' ----------------------------------------------------------------------------------------------------
  7463.         ''' <exception cref="ArgumentNullException">
  7464.         ''' driveRootPath
  7465.         ''' </exception>
  7466.         ''' ----------------------------------------------------------------------------------------------------
  7467.         <DebuggerStepThrough>
  7468.         Public Shared Sub NotifyMediaInserted(ByVal driveRootPath As String)
  7469.  
  7470.             If String.IsNullOrWhiteSpace(driveRootPath) Then
  7471.                 Throw New ArgumentNullException(paramName:="driveRootPath")
  7472.  
  7473.             Else
  7474.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.MediaInserted,
  7475.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7476.                                                              dwItem1:=driveRootPath, dwItem2:=Nothing)
  7477.             End If
  7478.  
  7479.         End Sub
  7480.  
  7481.         ''' ----------------------------------------------------------------------------------------------------
  7482.         ''' <summary>
  7483.         ''' Notifies the system that a storage media has been removed from a drive.
  7484.         ''' </summary>
  7485.         ''' ----------------------------------------------------------------------------------------------------
  7486.         ''' <param name="driveRootPath">
  7487.         ''' The root path of the drive from which the media was removed.
  7488.         ''' </param>
  7489.         ''' ----------------------------------------------------------------------------------------------------
  7490.         ''' <exception cref="ArgumentNullException">
  7491.         ''' driveRootPath
  7492.         ''' </exception>
  7493.         ''' ----------------------------------------------------------------------------------------------------
  7494.         <DebuggerStepThrough>
  7495.         Public Shared Sub NotifyMediaRemoved(ByVal driveRootPath As String)
  7496.  
  7497.             If String.IsNullOrWhiteSpace(driveRootPath) Then
  7498.                 Throw New ArgumentNullException(paramName:="driveRootPath")
  7499.  
  7500.             Else
  7501.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.MediaRemoved,
  7502.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7503.                                                              dwItem1:=driveRootPath, dwItem2:=Nothing)
  7504.             End If
  7505.  
  7506.         End Sub
  7507.  
  7508.         ''' ----------------------------------------------------------------------------------------------------
  7509.         ''' <summary>
  7510.         ''' Notifies the system that a directory on the local computer is being shared via the network.
  7511.         ''' </summary>
  7512.         ''' ----------------------------------------------------------------------------------------------------
  7513.         ''' <param name="directoryPath">
  7514.         ''' The full path of the directory that is being shared.
  7515.         ''' </param>
  7516.         ''' ----------------------------------------------------------------------------------------------------
  7517.         ''' <exception cref="ArgumentNullException">
  7518.         ''' directoryPath
  7519.         ''' </exception>
  7520.         ''' ----------------------------------------------------------------------------------------------------
  7521.         <DebuggerStepThrough>
  7522.         Public Shared Sub NotifyNetworkFolderShared(ByVal directoryPath As String)
  7523.  
  7524.             If String.IsNullOrWhiteSpace(directoryPath) Then
  7525.                 Throw New ArgumentNullException(paramName:="directoryPath")
  7526.  
  7527.             Else
  7528.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.NetShared,
  7529.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7530.                                                              dwItem1:=directoryPath, dwItem2:=Nothing)
  7531.             End If
  7532.  
  7533.         End Sub
  7534.  
  7535.         ''' ----------------------------------------------------------------------------------------------------
  7536.         ''' <summary>
  7537.         ''' Notifies the system that a directory on the local computer is no longer being shared via the network.
  7538.         ''' </summary>
  7539.         ''' ----------------------------------------------------------------------------------------------------
  7540.         ''' <param name="directoryPath">
  7541.         ''' The full path of the directory that is being not shared.
  7542.         ''' </param>
  7543.         ''' ----------------------------------------------------------------------------------------------------
  7544.         ''' <exception cref="ArgumentNullException">
  7545.         ''' directoryPath
  7546.         ''' </exception>
  7547.         ''' ----------------------------------------------------------------------------------------------------
  7548.         <DebuggerStepThrough>
  7549.         Public Shared Sub NotifyNetworkFolderUnshared(ByVal directoryPath As String)
  7550.  
  7551.             If String.IsNullOrWhiteSpace(directoryPath) Then
  7552.                 Throw New ArgumentNullException(paramName:="directoryPath")
  7553.  
  7554.             Else
  7555.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.NetUnshared,
  7556.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7557.                                                              dwItem1:=directoryPath, dwItem2:=Nothing)
  7558.             End If
  7559.  
  7560.         End Sub
  7561.  
  7562.         ''' ----------------------------------------------------------------------------------------------------
  7563.         ''' <summary>
  7564.         ''' Notifies the system that the attributes of a file have changed.
  7565.         ''' </summary>
  7566.         ''' ----------------------------------------------------------------------------------------------------
  7567.         ''' <param name="filePath">
  7568.         ''' The full path of the file on which its attributes has chaged.
  7569.         ''' </param>
  7570.         ''' ----------------------------------------------------------------------------------------------------
  7571.         ''' <exception cref="ArgumentNullException">
  7572.         ''' filePath
  7573.         ''' </exception>
  7574.         ''' ----------------------------------------------------------------------------------------------------
  7575.         <DebuggerStepThrough>
  7576.         Public Shared Sub NotifyFileAttributesChanged(ByVal filePath As String)
  7577.  
  7578.             If String.IsNullOrWhiteSpace(filePath) Then
  7579.                 Throw New ArgumentNullException(paramName:="filePath")
  7580.  
  7581.             Else
  7582.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.ItemAttributesChanged,
  7583.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7584.                                                              dwItem1:=filePath, dwItem2:=Nothing)
  7585.             End If
  7586.  
  7587.         End Sub
  7588.  
  7589.         ''' ----------------------------------------------------------------------------------------------------
  7590.         ''' <summary>
  7591.         ''' Notifies the system that the attributes of a directory have changed.
  7592.         ''' </summary>
  7593.         ''' ----------------------------------------------------------------------------------------------------
  7594.         ''' <param name="directoryPath">
  7595.         ''' The full path of the directory on which its attributes has chaged.
  7596.         ''' </param>
  7597.         ''' ----------------------------------------------------------------------------------------------------
  7598.         ''' <exception cref="ArgumentNullException">
  7599.         ''' directoryPath
  7600.         ''' </exception>
  7601.         ''' ----------------------------------------------------------------------------------------------------
  7602.         <DebuggerStepThrough>
  7603.         Public Shared Sub NotifyDirectoryAttributesChanged(ByVal directoryPath As String)
  7604.  
  7605.             If String.IsNullOrWhiteSpace(directoryPath) Then
  7606.                 Throw New ArgumentNullException(paramName:="directoryPath")
  7607.  
  7608.             Else
  7609.                 EnvironmentUtil.OS.NotifyFileAttributesChanged(directoryPath)
  7610.  
  7611.             End If
  7612.  
  7613.         End Sub
  7614.  
  7615.         ''' ----------------------------------------------------------------------------------------------------
  7616.         ''' <summary>
  7617.         ''' Notifies the system that the contents of an existing folder have changed but the folder still exists and has not been renamed.
  7618.         ''' </summary>
  7619.         ''' ----------------------------------------------------------------------------------------------------
  7620.         ''' <param name="directoryPath">
  7621.         ''' The full path of the directory that has chaged.
  7622.         ''' </param>
  7623.         ''' ----------------------------------------------------------------------------------------------------
  7624.         ''' <exception cref="ArgumentNullException">
  7625.         ''' directoryPath
  7626.         ''' </exception>
  7627.         ''' ----------------------------------------------------------------------------------------------------
  7628.         <DebuggerStepThrough>
  7629.         Public Shared Sub NotifyUpdateDirectory(ByVal directoryPath As String)
  7630.  
  7631.             If String.IsNullOrWhiteSpace(directoryPath) Then
  7632.                 Throw New ArgumentNullException(paramName:="directoryPath")
  7633.  
  7634.             Else
  7635.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.UpdateDirectory,
  7636.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7637.                                                              dwItem1:=directoryPath, dwItem2:=Nothing)
  7638.             End If
  7639.  
  7640.         End Sub
  7641.  
  7642.         ''' ----------------------------------------------------------------------------------------------------
  7643.         ''' <summary>
  7644.         ''' Notifies the system that a file type association has changed.
  7645.         ''' </summary>
  7646.         ''' ----------------------------------------------------------------------------------------------------
  7647.         <DebuggerStepThrough>
  7648.         Public Shared Sub NotifyFileAssociationChanged()
  7649.  
  7650.             EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.FileAssocChanged,
  7651.                                                          EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.ItemIdList,
  7652.                                                          dwItem1:=Nothing, dwItem2:=Nothing)
  7653.  
  7654.         End Sub
  7655.  
  7656.         ''' ----------------------------------------------------------------------------------------------------
  7657.         ''' <summary>
  7658.         ''' Notifies the system that amount of free space on a drive has changed.
  7659.         ''' </summary>
  7660.         ''' ----------------------------------------------------------------------------------------------------
  7661.         ''' <param name="driveRootPath">
  7662.         ''' The root path of the drive on which the free space changed.
  7663.         ''' </param>
  7664.         ''' ----------------------------------------------------------------------------------------------------
  7665.         ''' <exception cref="ArgumentNullException">
  7666.         ''' driveRootPath
  7667.         ''' </exception>
  7668.         ''' ----------------------------------------------------------------------------------------------------
  7669.         <DebuggerStepThrough>
  7670.         Public Shared Sub NotifyFreespaceChanged(ByVal driveRootPath As String)
  7671.  
  7672.             If String.IsNullOrWhiteSpace(driveRootPath) Then
  7673.                 Throw New ArgumentNullException(paramName:="driveRootPath")
  7674.  
  7675.             Else
  7676.                 EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.FreespaceChanged,
  7677.                                                              EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.PathA,
  7678.                                                              dwItem1:=driveRootPath, dwItem2:=Nothing)
  7679.             End If
  7680.  
  7681.         End Sub
  7682.  
  7683.         ''' ----------------------------------------------------------------------------------------------------
  7684.         ''' <summary>
  7685.         ''' Notifies the system that an image in the system image list has changed.
  7686.         ''' </summary>
  7687.         ''' ----------------------------------------------------------------------------------------------------
  7688.         <DebuggerStepThrough>
  7689.         Public Shared Sub NotifyUpdateImage()
  7690.  
  7691.             EnvironmentUtil.NativeMethods.SHChangeNotify(EnvironmentUtil.NativeMethods.SHChangeNotifyEventID.UpdateImage,
  7692.                                                          EnvironmentUtil.NativeMethods.SHChangeNotifyFlags.Dword,
  7693.                                                          dwItem1:=Nothing, dwItem2:=Nothing)
  7694.  
  7695.         End Sub
  7696.  
  7697.         ''' ----------------------------------------------------------------------------------------------------
  7698.         ''' <summary>
  7699.         ''' Displays the Taskbar and Start Menu Properties dialog box.
  7700.         ''' This method has the same effect as right-clicking the taskbar and selecting Properties.
  7701.         ''' </summary>
  7702.         ''' ----------------------------------------------------------------------------------------------------
  7703.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774105%28v=vs.85%29.aspx</remarks>
  7704.         ''' ----------------------------------------------------------------------------------------------------
  7705.         <DebuggerStepThrough>
  7706.         Public Shared Sub RunTrayProperties()
  7707.  
  7708.             Dim shell As New Shell32.Shell
  7709.             shell.TrayProperties()
  7710.             shell = Nothing
  7711.  
  7712.         End Sub
  7713.  
  7714.         ''' ----------------------------------------------------------------------------------------------------
  7715.         ''' <summary>
  7716.         ''' Displays the Date and Time Properties dialog box.
  7717.         ''' This method has the same effect as right-clicking the clock in the taskbar status area and selecting Adjust Date/Time.
  7718.         ''' </summary>
  7719.         ''' ----------------------------------------------------------------------------------------------------
  7720.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774092%28v=vs.85%29.aspx</remarks>
  7721.         ''' ----------------------------------------------------------------------------------------------------
  7722.         <DebuggerStepThrough>
  7723.         Public Shared Sub RunDateTime()
  7724.  
  7725.             Dim shell As New Shell32.Shell
  7726.             shell.SetTime()
  7727.             shell = Nothing
  7728.  
  7729.         End Sub
  7730.  
  7731.         ''' ----------------------------------------------------------------------------------------------------
  7732.         ''' <summary>
  7733.         ''' Displays the Apps Search pane.
  7734.         ''' </summary>
  7735.         ''' ----------------------------------------------------------------------------------------------------
  7736.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/jj635751%28v=vs.85%29.aspx</remarks>
  7737.         ''' ----------------------------------------------------------------------------------------------------
  7738.         <DebuggerStepThrough>
  7739.         Public Shared Sub RunSearchCommand()
  7740.  
  7741.             Dim shell As New Shell32.Shell
  7742.             shell.SearchCommand()
  7743.             shell = Nothing
  7744.  
  7745.         End Sub
  7746.  
  7747.         ''' ----------------------------------------------------------------------------------------------------
  7748.         ''' <summary>
  7749.         ''' Invokes the Window Switcher (ALT+TAB).
  7750.         ''' </summary>
  7751.         ''' ----------------------------------------------------------------------------------------------------
  7752.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/gg537749%28v=vs.85%29.aspx</remarks>
  7753.         ''' ----------------------------------------------------------------------------------------------------
  7754.         <DebuggerStepThrough>
  7755.         Public Shared Sub RunWindowSwitcher()
  7756.  
  7757.             Dim shell As New Shell32.Shell
  7758.             shell.WindowSwitcher()
  7759.             shell = Nothing
  7760.  
  7761.         End Sub
  7762.  
  7763.         ''' ----------------------------------------------------------------------------------------------------
  7764.         ''' <summary>
  7765.         ''' Displays the Run dialog to the user.
  7766.         ''' This method has the same effect as clicking the Start menu and selecting Run.
  7767.         ''' </summary>
  7768.         ''' ----------------------------------------------------------------------------------------------------
  7769.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774075%28v=vs.85%29.aspx</remarks>
  7770.         ''' ----------------------------------------------------------------------------------------------------
  7771.         <DebuggerStepThrough>
  7772.         Public Shared Sub RunExecuteDialog()
  7773.  
  7774.             Dim shell As New Shell32.Shell
  7775.             shell.FileRun()
  7776.             shell = Nothing
  7777.  
  7778.         End Sub
  7779.  
  7780.         ''' ----------------------------------------------------------------------------------------------------
  7781.         ''' <summary>
  7782.         ''' Displays the Search Results: Computers dialog box.
  7783.         ''' The dialog box shows the result of the search for a specified computer.
  7784.         ''' </summary>
  7785.         ''' ----------------------------------------------------------------------------------------------------
  7786.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774077%28v=vs.85%29.aspx</remarks>
  7787.         ''' ----------------------------------------------------------------------------------------------------
  7788.         <DebuggerStepThrough>
  7789.         Public Shared Sub RunFindComputer()
  7790.  
  7791.             Dim shell As New Shell32.Shell
  7792.             shell.FindComputer()
  7793.             shell = Nothing
  7794.  
  7795.         End Sub
  7796.  
  7797.         ''' ----------------------------------------------------------------------------------------------------
  7798.         ''' <summary>
  7799.         ''' Displays the Find: All Files dialog box.
  7800.         ''' This is the same as clicking the Start menu and then selecting "Search".
  7801.         ''' </summary>
  7802.         ''' ----------------------------------------------------------------------------------------------------
  7803.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774079%28v=vs.85%29.aspx</remarks>
  7804.         ''' ----------------------------------------------------------------------------------------------------
  7805.         <DebuggerStepThrough>
  7806.         Public Shared Sub RunFindFiles()
  7807.  
  7808.             Dim shell As New Shell32.Shell
  7809.             shell.FindFiles()
  7810.             shell = Nothing
  7811.  
  7812.         End Sub
  7813.  
  7814.         ''' ----------------------------------------------------------------------------------------------------
  7815.         ''' <summary>
  7816.         ''' Displays the Find Printer dialog box.
  7817.         ''' </summary>
  7818.         ''' ----------------------------------------------------------------------------------------------------
  7819.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/gg537738%28v=vs.85%29.aspx</remarks>
  7820.         ''' ----------------------------------------------------------------------------------------------------
  7821.         <DebuggerStepThrough>
  7822.         Public Shared Sub RunFindPrinter()
  7823.  
  7824.             Dim shell As New Shell32.Shell
  7825.             shell.FindPrinter()
  7826.             shell = Nothing
  7827.  
  7828.         End Sub
  7829.  
  7830.         ''' ----------------------------------------------------------------------------------------------------
  7831.         ''' <summary>
  7832.         ''' Displays the Windows Help and Support Center.
  7833.         ''' This method has the same effect as clicking the Start menu and selecting Help and Support.
  7834.         ''' </summary>
  7835.         ''' ----------------------------------------------------------------------------------------------------
  7836.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/bb774081%28v=vs.85%29.aspx</remarks>
  7837.         ''' ----------------------------------------------------------------------------------------------------
  7838.         <DebuggerStepThrough>
  7839.         Public Shared Sub RunHelpCenter()
  7840.  
  7841.             Dim shell As New Shell32.Shell
  7842.             shell.Help()
  7843.             shell = Nothing
  7844.  
  7845.         End Sub
  7846.  
  7847.         ''' ----------------------------------------------------------------------------------------------------
  7848.         ''' <summary>
  7849.         ''' Displays the Windows Security dialog box.
  7850.         ''' </summary>
  7851.         ''' ----------------------------------------------------------------------------------------------------
  7852.         ''' <remarks>https://msdn.microsoft.com/en-us/library/windows/desktop/gg537748%28v=vs.85%29.aspx</remarks>
  7853.         ''' ----------------------------------------------------------------------------------------------------
  7854.         <DebuggerStepThrough>
  7855.         Public Shared Sub RunWindowsSecurity()
  7856.  
  7857.             Dim shell As New Shell32.Shell
  7858.             shell.WindowsSecurity()
  7859.             shell = Nothing
  7860.  
  7861.         End Sub
  7862.  
  7863. #End Region
  7864.  
  7865.     End Class
  7866.  
  7867. #End Region
  7868.  
  7869. #Region " Programs "
  7870.  
  7871.     ''' ----------------------------------------------------------------------------------------------------
  7872.     ''' <summary>
  7873.     ''' Contains related Windows programs utilities.
  7874.     ''' </summary>
  7875.     ''' ----------------------------------------------------------------------------------------------------
  7876.     Public NotInheritable Class Programs
  7877.  
  7878. #Region " Properties "
  7879.  
  7880.         ''' ----------------------------------------------------------------------------------------------------
  7881.         ''' <summary>
  7882.         ''' Gets the filepath of the default web-browser that is registered on the current operating system.
  7883.         ''' </summary>
  7884.         ''' ----------------------------------------------------------------------------------------------------
  7885.         ''' <value>
  7886.         ''' The filepath of the default web-browser that is registered on the current operating system.
  7887.         ''' </value>
  7888.         ''' ----------------------------------------------------------------------------------------------------
  7889.         Public Shared ReadOnly Property DefaultWebBrowser As String
  7890.             <DebuggerStepThrough>
  7891.             Get
  7892.  
  7893.                 Dim regValue As String = String.Empty
  7894.  
  7895.                 Using regKey As RegistryKey = Registry.ClassesRoot.OpenSubKey("HTTP\Shell\Open\Command", writable:=False)
  7896.  
  7897.                     regValue = regKey.GetValue(Nothing, String.Empty, RegistryValueOptions.None).ToString
  7898.  
  7899.                     regValue = regValue.Substring(0, regValue.LastIndexOf(".exe", StringComparison.OrdinalIgnoreCase) + ".exe".Length).
  7900.                                         Trim({ControlChars.Quote})
  7901.  
  7902.                 End Using
  7903.  
  7904.                 Return regValue
  7905.             End Get
  7906.         End Property
  7907.  
  7908.         ''' ----------------------------------------------------------------------------------------------------
  7909.         ''' <summary>
  7910.         ''' Gets the version of the Internet Explorer that is installed on the current operating system.
  7911.         ''' </summary>
  7912.         ''' ----------------------------------------------------------------------------------------------------
  7913.         ''' <value>
  7914.         ''' The version of the Internet Explorer that is installed on the current operating system.
  7915.         ''' </value>
  7916.         ''' ----------------------------------------------------------------------------------------------------
  7917.         Public Shared ReadOnly Property IExplorerVersion() As Version
  7918.             <DebuggerStepThrough>
  7919.             Get
  7920.                 Return New Version(FileVersionInfo.GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "ieframe.dll")).ProductVersion)
  7921.             End Get
  7922.         End Property
  7923.  
  7924. #End Region
  7925.  
  7926. #Region " Constructors "
  7927.  
  7928.         ''' ----------------------------------------------------------------------------------------------------
  7929.         ''' <summary>
  7930.         ''' Prevents a default instance of the <see cref="Programs"/> class from being created.
  7931.         ''' </summary>
  7932.         ''' ----------------------------------------------------------------------------------------------------
  7933.         Private Sub New()
  7934.         End Sub
  7935.  
  7936. #End Region
  7937.  
  7938.     End Class
  7939.  
  7940. #End Region
  7941.  
  7942. #Region " Theming "
  7943.  
  7944.     ''' ----------------------------------------------------------------------------------------------------
  7945.     ''' <summary>
  7946.     ''' Contains related theming/personalization utilities.
  7947.     ''' </summary>
  7948.     ''' ----------------------------------------------------------------------------------------------------
  7949.     Public NotInheritable Class Theming
  7950.  
  7951. #Region " Types "
  7952.  
  7953. #Region " ThemeInfo "
  7954.  
  7955.         ''' <summary>
  7956.         ''' Defined the information of a Windows Visual Theme.
  7957.         ''' </summary>
  7958.         <Serializable>
  7959.         Public NotInheritable Class ThemeInfo
  7960.  
  7961. #Region " Properties "
  7962.  
  7963.             ''' ----------------------------------------------------------------------------------------------------
  7964.             ''' <summary>
  7965.             ''' Gets the theme filename.
  7966.             ''' </summary>
  7967.             ''' ----------------------------------------------------------------------------------------------------
  7968.             ''' <value>
  7969.             ''' The theme filename.
  7970.             ''' </value>
  7971.             ''' ----------------------------------------------------------------------------------------------------
  7972.             Public ReadOnly Property FileName() As String
  7973.                 <DebuggerStepThrough>
  7974.                 Get
  7975.                     Return Path.GetFileName(Me.filepathB)
  7976.                 End Get
  7977.             End Property
  7978.  
  7979.             ''' ----------------------------------------------------------------------------------------------------
  7980.             ''' <summary>
  7981.             ''' Gets the theme filepath.
  7982.             ''' </summary>
  7983.             ''' ----------------------------------------------------------------------------------------------------
  7984.             ''' <value>
  7985.             ''' The theme filepath.
  7986.             ''' </value>
  7987.             ''' ----------------------------------------------------------------------------------------------------
  7988.             Public ReadOnly Property Filepath() As String
  7989.                 <DebuggerStepThrough>
  7990.                 Get
  7991.                     Return Me.filepathB
  7992.                 End Get
  7993.             End Property
  7994.             ''' <summary>
  7995.             ''' ( Backing Field )
  7996.             ''' The theme filepath.
  7997.             ''' </summary>
  7998.             Private ReadOnly filepathB As String
  7999.  
  8000.             ''' ----------------------------------------------------------------------------------------------------
  8001.             ''' <summary>
  8002.             ''' Gets the theme color scheme name.
  8003.             ''' </summary>
  8004.             ''' ----------------------------------------------------------------------------------------------------
  8005.             ''' <value>
  8006.             ''' The theme color scheme name.
  8007.             ''' </value>
  8008.             ''' ----------------------------------------------------------------------------------------------------
  8009.             Public ReadOnly Property ColorSchemeName() As String
  8010.                 <DebuggerStepThrough>
  8011.                 Get
  8012.                     Return Me.colorSchemeNameB
  8013.                 End Get
  8014.             End Property
  8015.             ''' <summary>
  8016.             ''' ( Backing Field )
  8017.             ''' The theme color scheme name.
  8018.             ''' </summary>
  8019.             Private ReadOnly colorSchemeNameB As String
  8020.  
  8021.             ''' ----------------------------------------------------------------------------------------------------
  8022.             ''' <summary>
  8023.             ''' Gets the theme size name.
  8024.             ''' </summary>
  8025.             ''' ----------------------------------------------------------------------------------------------------
  8026.             ''' <value>
  8027.             ''' The theme size name.
  8028.             ''' </value>
  8029.             ''' ----------------------------------------------------------------------------------------------------
  8030.             Public ReadOnly Property SizeName() As String
  8031.                 <DebuggerStepThrough>
  8032.                 Get
  8033.                     Return Me.sizeNameB
  8034.                 End Get
  8035.             End Property
  8036.             ''' <summary>
  8037.             ''' ( Backing Field )
  8038.             ''' The theme size name.
  8039.             ''' </summary>
  8040.             Private ReadOnly sizeNameB As String
  8041.  
  8042. #End Region
  8043.  
  8044. #Region " Constructors "
  8045.  
  8046.             ''' ----------------------------------------------------------------------------------------------------
  8047.             ''' <summary>
  8048.             ''' Initializes a new instance of the <see cref="ThemeInfo"/> class.
  8049.             ''' </summary>
  8050.             ''' ----------------------------------------------------------------------------------------------------
  8051.             ''' <param name="filepath">
  8052.             ''' The theme filepath.
  8053.             ''' </param>
  8054.             '''
  8055.             ''' <param name="colorSchemeName">
  8056.             ''' The theme color scheme name.
  8057.             ''' </param>
  8058.             '''
  8059.             ''' <param name="sizeName">The theme size name.
  8060.             ''' </param>
  8061.             ''' ----------------------------------------------------------------------------------------------------
  8062.             ''' <exception cref="ArgumentNullException">
  8063.             ''' filepath or colorSchemeName or sizeName
  8064.             ''' </exception>
  8065.             ''' ----------------------------------------------------------------------------------------------------
  8066.             <DebuggerStepThrough>
  8067.             Public Sub New(ByVal filepath As String,
  8068.                            ByVal colorSchemeName As String,
  8069.                            ByVal sizeName As String)
  8070.  
  8071.                 If String.IsNullOrWhiteSpace(filepath) Then
  8072.                     Throw New ArgumentNullException(paramName:="filepath")
  8073.  
  8074.                 ElseIf String.IsNullOrWhiteSpace(colorSchemeName) Then
  8075.                     Throw New ArgumentNullException(paramName:="colorSchemeName")
  8076.  
  8077.                 ElseIf String.IsNullOrWhiteSpace(sizeName) Then
  8078.                     Throw New ArgumentNullException(paramName:="sizeName")
  8079.  
  8080.                 Else
  8081.                     Me.filepathB = filepath
  8082.                     Me.colorSchemeNameB = colorSchemeName
  8083.                     Me.sizeNameB = sizeName
  8084.  
  8085.                 End If
  8086.  
  8087.             End Sub
  8088.  
  8089.             ''' ----------------------------------------------------------------------------------------------------
  8090.             ''' <summary>
  8091.             ''' Prevents a default instance of the <see cref="ThemeInfo"/> class from being created.
  8092.             ''' </summary>
  8093.             ''' ----------------------------------------------------------------------------------------------------
  8094.             <DebuggerStepThrough>
  8095.             Private Sub New()
  8096.             End Sub
  8097.  
  8098. #End Region
  8099.  
  8100.         End Class
  8101.  
  8102. #End Region
  8103.  
  8104. #End Region
  8105.  
  8106. #Region " Properties "
  8107.  
  8108.         ''' ----------------------------------------------------------------------------------------------------
  8109.         ''' <summary>
  8110.         ''' Gets a <see cref="EnvironmentUtil.Theming.ThemeInfo"/> object that contains the info of the current windows theme.
  8111.         ''' </summary>
  8112.         ''' ----------------------------------------------------------------------------------------------------
  8113.         ''' <value>
  8114.         ''' A <see cref="EnvironmentUtil.Theming.ThemeInfo"/> object that contains the info of the current windows theme.
  8115.         ''' </value>
  8116.         ''' ----------------------------------------------------------------------------------------------------
  8117.         Public Shared ReadOnly Property CurrentTheme() As ThemeInfo
  8118.             <DebuggerStepThrough>
  8119.             Get
  8120.                 Return EnvironmentUtil.Theming.GetCurrentThemeInfo()
  8121.             End Get
  8122.         End Property
  8123.  
  8124.         ''' ----------------------------------------------------------------------------------------------------
  8125.         ''' <summary>
  8126.         ''' Gets the filepath of the current desktop wallpaper.
  8127.         ''' </summary>
  8128.         ''' ----------------------------------------------------------------------------------------------------
  8129.         ''' <value>
  8130.         ''' The filepath of the current desktop wallpaper.
  8131.         ''' </value>
  8132.         ''' ----------------------------------------------------------------------------------------------------
  8133.         Public Shared ReadOnly Property CurrentWallpaper() As String
  8134.             <DebuggerStepThrough>
  8135.             Get
  8136.                 Dim sb As New StringBuilder(capacity:=260)
  8137.  
  8138.                 Dim uiAction As EnvironmentUtil.NativeMethods.SystemParametersActionFlags =
  8139.                     EnvironmentUtil.NativeMethods.SystemParametersActionFlags.GetDesktopWallpaper
  8140.  
  8141.                 If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(uiAction, CUInt(sb.Capacity), sb, Nothing) Then
  8142.                     Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  8143.                 Else
  8144.                     Return sb.ToString
  8145.                 End If
  8146.             End Get
  8147.         End Property
  8148.  
  8149.         ''' ----------------------------------------------------------------------------------------------------
  8150.         ''' <summary>
  8151.         ''' Gets a value indicating whether Aero feature is enabled on the current operating system.
  8152.         ''' </summary>
  8153.         ''' ----------------------------------------------------------------------------------------------------
  8154.         ''' <value>
  8155.         ''' <c>True</c> if Aero feature is enabled on the current operating system.
  8156.         ''' <c>False</c> if Aero feature is not enabled or else is not supported by the current operating system (like Windows XP or previous versions).
  8157.         ''' </value>
  8158.         ''' ----------------------------------------------------------------------------------------------------
  8159.         Public Shared ReadOnly Property AeroEnabled() As Boolean
  8160.             <DebuggerStepThrough>
  8161.             Get
  8162.                 If Environment.OSVersion.Version.Major < 6 Then
  8163.                     Return False ' Windows version is below Windows Vista so not Aero disponible.
  8164.  
  8165.                 Else
  8166.                     Dim isEnabled As Boolean
  8167.                     EnvironmentUtil.NativeMethods.DwmIsCompositionEnabled(isEnabled)
  8168.                     Return isEnabled
  8169.  
  8170.                 End If
  8171.             End Get
  8172.         End Property
  8173.  
  8174.         ''' ----------------------------------------------------------------------------------------------------
  8175.         ''' <summary>
  8176.         ''' Gets a value indicating whether Aero feature is supported by the current operating system.
  8177.         ''' </summary>
  8178.         ''' ----------------------------------------------------------------------------------------------------
  8179.         ''' <value>
  8180.         ''' <c>True</c> if Aero feature is supported by the current operating system.
  8181.         ''' <c>False</c> if Aero feature is not supported by the current operating system.
  8182.         ''' </value>
  8183.         ''' ----------------------------------------------------------------------------------------------------
  8184.         Public Shared ReadOnly Property AeroSupported() As Boolean
  8185.             <DebuggerStepThrough>
  8186.             Get
  8187.                 Return (Environment.OSVersion.Version.Major > 5) ' Windows version is above Windows XP.
  8188.             End Get
  8189.         End Property
  8190.  
  8191.         ''' ----------------------------------------------------------------------------------------------------
  8192.         ''' <summary>
  8193.         ''' Gets a value that determines wheter jpeg files are supported as wallpaper in the current operating system.
  8194.         ''' The jpeg wallpapers are not supported before Windows Vista.
  8195.         ''' </summary>
  8196.         ''' ----------------------------------------------------------------------------------------------------
  8197.         ''' <value>
  8198.         ''' <c>True</c> if jpeg files are supported as wallpaper in the current operating system, otherwise, <c>False</c>
  8199.         ''' </value>
  8200.         ''' ----------------------------------------------------------------------------------------------------
  8201.         Public Shared ReadOnly Property WallpaperAsJpegIsSupported() As Boolean
  8202.             <DebuggerStepThrough>
  8203.             Get
  8204.                 Return Environment.OSVersion.Version >= New Version(6, 0)
  8205.             End Get
  8206.         End Property
  8207.  
  8208.         ''' ----------------------------------------------------------------------------------------------------
  8209.         ''' <summary>
  8210.         ''' Gets a value that determines whether the <see cref="WallpaperStyle.Fit"/> and <see cref="WallpaperStyle.Fill"/> are
  8211.         ''' supported in the current operating system.
  8212.         '''
  8213.         ''' The <see cref="WallpaperStyle.Fit"/> and <see cref="WallpaperStyle.Fill"/> wallpaper styles are not supported before Windows 7.
  8214.         ''' </summary>
  8215.         ''' ----------------------------------------------------------------------------------------------------
  8216.         ''' <value>
  8217.         ''' <c>True</c> if <see cref="WallpaperStyle.Fit"/> and <see cref="WallpaperStyle.Fill"/> are supported in the current operating system,
  8218.         ''' otherwise, <c>False</c>
  8219.         ''' </value>
  8220.         ''' ----------------------------------------------------------------------------------------------------
  8221.         Public Shared ReadOnly Property WallpaperStylesFitFillAreSupported() As Boolean
  8222.             <DebuggerStepThrough>
  8223.             Get
  8224.                 Return Environment.OSVersion.Version >= New Version(6, 1)
  8225.             End Get
  8226.         End Property
  8227.  
  8228. #End Region
  8229.  
  8230. #Region " Enumerations "
  8231.  
  8232.         ''' <summary>
  8233.         ''' Describes a wallpaper style.
  8234.         ''' </summary>
  8235.         Public Enum WallpaperStyle As Integer
  8236.  
  8237.             ''' <summary>
  8238.             ''' If the image is smaller than the screen, this style puts a clone of the image across the screen background.
  8239.             ''' </summary>
  8240.             Tile = 0
  8241.  
  8242.             ''' <summary>
  8243.             ''' Centers the image on the screen.
  8244.             ''' </summary>
  8245.             Center = 1
  8246.  
  8247.             ''' <summary>
  8248.             ''' Shrinks or enlarges the image to fit the monitor's height and widht.
  8249.             ''' </summary>
  8250.             Stretch = 2
  8251.  
  8252.             ''' <summary>
  8253.             ''' Shrinks or enlarges the image to fit the monitor's height.
  8254.             ''' </summary>
  8255.             Fit = 3
  8256.  
  8257.             ''' <summary>
  8258.             ''' Shrinks or enlarges the image to fit the monitor's width.
  8259.             ''' </summary>
  8260.             Fill = 4
  8261.  
  8262.         End Enum
  8263.  
  8264.         ''' <summary>
  8265.         ''' Specifies a cursor type.
  8266.         ''' </summary>
  8267.         Public Enum CursorType As Short
  8268.  
  8269.             ''' <summary>
  8270.             ''' Standard arrow and small hourglass.
  8271.             ''' </summary>
  8272.             AppStarting = EnvironmentUtil.NativeMethods.SystemCursorId.AppStarting
  8273.  
  8274.             ''' <summary>
  8275.             ''' Standard arrow.
  8276.             ''' </summary>
  8277.             Arrow = EnvironmentUtil.NativeMethods.SystemCursorId.Arrow
  8278.  
  8279.             ''' <summary>
  8280.             ''' Crosshair.
  8281.             ''' </summary>
  8282.             Crosshair = EnvironmentUtil.NativeMethods.SystemCursorId.Crosshair
  8283.  
  8284.             ''' <summary>
  8285.             ''' Hand.
  8286.             ''' </summary>
  8287.             Hand = EnvironmentUtil.NativeMethods.SystemCursorId.Hand
  8288.  
  8289.             ''' <summary>
  8290.             ''' Arrow and question mark.
  8291.             ''' </summary>
  8292.             Help = EnvironmentUtil.NativeMethods.SystemCursorId.Help
  8293.  
  8294.             ''' <summary>
  8295.             ''' I-beam.
  8296.             ''' </summary>
  8297.             IBeam = EnvironmentUtil.NativeMethods.SystemCursorId.IBeam
  8298.  
  8299.             ''' <summary>
  8300.             ''' Slashed circle.
  8301.             ''' </summary>
  8302.             No = EnvironmentUtil.NativeMethods.SystemCursorId.No
  8303.  
  8304.             ''' <summary>
  8305.             ''' Four-pointed arrow pointing north, south, east, and west.
  8306.             ''' </summary>
  8307.             SizeAll = EnvironmentUtil.NativeMethods.SystemCursorId.SizeAll
  8308.  
  8309.             ''' <summary>
  8310.             ''' Double-pointed arrow pointing northeast and southwest.
  8311.             ''' </summary>
  8312.             Size_NESW = EnvironmentUtil.NativeMethods.SystemCursorId.Size_NESW
  8313.  
  8314.             ''' <summary>
  8315.             ''' Double-pointed arrow pointing north and south.
  8316.             ''' </summary>
  8317.             Size_NS = EnvironmentUtil.NativeMethods.SystemCursorId.Size_NS
  8318.  
  8319.             ''' <summary>
  8320.             ''' Double-pointed arrow pointing northwest and southeast.
  8321.             ''' </summary>
  8322.             Size_NWSE = EnvironmentUtil.NativeMethods.SystemCursorId.Size_NWSE
  8323.  
  8324.             ''' <summary>
  8325.             ''' Double-pointed arrow pointing west and east.
  8326.             ''' </summary>
  8327.             Size_WE = EnvironmentUtil.NativeMethods.SystemCursorId.Size_WE
  8328.  
  8329.             ''' <summary>
  8330.             ''' Vertical arrow.
  8331.             ''' </summary>
  8332.             Up = EnvironmentUtil.NativeMethods.SystemCursorId.Up
  8333.  
  8334.             ''' <summary>
  8335.             ''' Hourglass.
  8336.             ''' </summary>
  8337.             Wait = EnvironmentUtil.NativeMethods.SystemCursorId.Wait
  8338.  
  8339.         End Enum
  8340.  
  8341. #End Region
  8342.  
  8343. #Region " Constructors "
  8344.  
  8345.         ''' ----------------------------------------------------------------------------------------------------
  8346.         ''' <summary>
  8347.         ''' Prevents a default instance of the <see cref="Theming"/> class from being created.
  8348.         ''' </summary>
  8349.         ''' ----------------------------------------------------------------------------------------------------
  8350.         Private Sub New()
  8351.         End Sub
  8352.  
  8353. #End Region
  8354.  
  8355. #Region " Public Methods "
  8356.  
  8357.         ''' ----------------------------------------------------------------------------------------------------
  8358.         ''' <summary>
  8359.         ''' Sets the current desktop wallpaper.
  8360.         ''' </summary>
  8361.         ''' ----------------------------------------------------------------------------------------------------
  8362.         ''' <param name="imagePath">
  8363.         ''' The wallpaper filepath.
  8364.         ''' </param>
  8365.         '''
  8366.         ''' <param name="style">
  8367.         ''' The wallpaper style to apply.
  8368.         ''' </param>
  8369.         ''' ----------------------------------------------------------------------------------------------------
  8370.         ''' <exception cref="ArgumentNullException">
  8371.         ''' imagepath
  8372.         ''' </exception>
  8373.         '''
  8374.         ''' <exception cref="ArgumentException">
  8375.         ''' Invalid enumeration value;style
  8376.         ''' </exception>
  8377.         '''
  8378.         ''' <exception cref="Exception">
  8379.         ''' The current operating system doesn't support a fitted or filled wallpaper.
  8380.         ''' </exception>
  8381.         '''
  8382.         ''' <exception cref="Win32Exception">
  8383.         ''' </exception>
  8384.         ''' ----------------------------------------------------------------------------------------------------
  8385.         Public Shared Sub SetDesktopWallpaper(ByVal imagePath As String,
  8386.                                               ByVal style As WallpaperStyle)
  8387.  
  8388.             If String.IsNullOrWhiteSpace(imagePath) Then
  8389.                 Throw New ArgumentNullException(paramName:="imagepath")
  8390.  
  8391.             Else
  8392.                 ' Set the wallpaper style and tile.
  8393.                 ' Two registry values are set in the 'HKxx\Control Panel\Desktop' key.
  8394.                 '
  8395.                 ' TileWallpaper:
  8396.                 '  0: The wallpaper picture should not be tiled .
  8397.                 '  1: The wallpaper picture should be tiled .
  8398.                 '
  8399.                 ' WallpaperStyle:
  8400.                 '  0:  The image is centered if 'TileWallpaper=0' or tiled if 'TileWallpaper=1'.
  8401.                 '  2:  The image is stretched to fill the screen.
  8402.                 '  6:  The image is resized to fit the screen while maintaining the aspect ratio. (Windows 7 and higher)
  8403.                 ' 10: The image is resized and cropped to fill the screen while maintaining the aspect ratio. (Windows 7 and higher)
  8404.                 Using regKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop", writable:=True)
  8405.  
  8406.                     Select Case style
  8407.  
  8408.                         Case WallpaperStyle.Tile
  8409.                             regKey.SetValue("WallpaperStyle", "0")
  8410.                             regKey.SetValue("TileWallpaper", "1")
  8411.  
  8412.                         Case WallpaperStyle.Center
  8413.                             regKey.SetValue("WallpaperStyle", "0")
  8414.                             regKey.SetValue("TileWallpaper", "0")
  8415.  
  8416.                         Case WallpaperStyle.Stretch
  8417.                             regKey.SetValue("WallpaperStyle", "2")
  8418.                             regKey.SetValue("TileWallpaper", "0")
  8419.  
  8420.                         Case WallpaperStyle.Fit ' (Windows 7 and higher)
  8421.                             regKey.SetValue("WallpaperStyle", "6")
  8422.                             regKey.SetValue("TileWallpaper", "0")
  8423.  
  8424.                         Case WallpaperStyle.Fill ' (Windows 7 and higher)
  8425.                             regKey.SetValue("WallpaperStyle", "10")
  8426.                             regKey.SetValue("TileWallpaper", "0")
  8427.  
  8428.                         Case Else
  8429.                             Throw New ArgumentException(message:="Invalid enumeration value", paramName:="style")
  8430.  
  8431.                     End Select
  8432.  
  8433.                 End Using
  8434.  
  8435.                 Dim imageExt As String = Path.GetExtension(imagePath)
  8436.  
  8437.                 If (imageExt.Equals(".jpg", StringComparison.OrdinalIgnoreCase) OrElse imageExt.Equals(".jpeg", StringComparison.OrdinalIgnoreCase)) AndAlso
  8438.                     Not (EnvironmentUtil.Theming.WallpaperStylesFitFillAreSupported) Then
  8439.  
  8440.                     Throw New Exception(message:="The current operating system doesn't support a fitted or filled wallpaper.")
  8441.  
  8442.                 Else
  8443.                     Dim uiAction As EnvironmentUtil.NativeMethods.SystemParametersActionFlags =
  8444.                         EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDesktopWallpaper
  8445.  
  8446.                     If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(uiAction, Nothing, imagePath, EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  8447.                         Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  8448.                     End If
  8449.  
  8450.                 End If
  8451.  
  8452.             End If
  8453.  
  8454.         End Sub
  8455.  
  8456.         ''' ----------------------------------------------------------------------------------------------------
  8457.         ''' <summary>
  8458.         ''' Removes the current desktop wallpaper from screen.
  8459.         ''' </summary>
  8460.         ''' ----------------------------------------------------------------------------------------------------
  8461.         ''' <exception cref="Win32Exception">
  8462.         ''' </exception>
  8463.         ''' ----------------------------------------------------------------------------------------------------
  8464.         Public Shared Sub RemoveDesktopWallpaper()
  8465.  
  8466.             Dim uiAction As EnvironmentUtil.NativeMethods.SystemParametersActionFlags =
  8467.                 EnvironmentUtil.NativeMethods.SystemParametersActionFlags.SetDesktopWallpaper
  8468.  
  8469.             If Not EnvironmentUtil.NativeMethods.SystemParametersInfo(uiAction, Nothing, String.Empty, EnvironmentUtil.NativeMethods.SystemParametersWinIniFlags.None) Then
  8470.                 Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  8471.             End If
  8472.  
  8473.         End Sub
  8474.  
  8475.         ''' ----------------------------------------------------------------------------------------------------
  8476.         ''' <example>
  8477.         ''' EnvironmentUtil.Theming.SetSystemCursor("C:\Windows\Cursors\aero_pen.cur", EnvironmentUtil.Theming.CursorType.Arrow)
  8478.         ''' </example>
  8479.         ''' ----------------------------------------------------------------------------------------------------
  8480.         ''' <summary>
  8481.         ''' Sets the system cursor.
  8482.         ''' </summary>
  8483.         ''' ----------------------------------------------------------------------------------------------------
  8484.         ''' <param name="filePath">
  8485.         ''' The cursor file path.
  8486.         ''' </param>
  8487.         '''
  8488.         ''' <param name="cursorType">
  8489.         ''' The cursor type.
  8490.         ''' </param>
  8491.         ''' ----------------------------------------------------------------------------------------------------
  8492.         Public Shared Sub SetSystemCursor(ByVal filePath As String,
  8493.                                           ByVal cursorType As EnvironmentUtil.Theming.CursorType)
  8494.  
  8495.             If Not EnvironmentUtil.NativeMethods.SetSystemCursor(EnvironmentUtil.NativeMethods.LoadCursorFromFile(filePath), cursorType) Then
  8496.                 Throw New Win32Exception([error]:=Marshal.GetLastWin32Error)
  8497.             End If
  8498.  
  8499.         End Sub
  8500.  
  8501. #End Region
  8502.  
  8503. #Region " Private Methods "
  8504.  
  8505.         ''' ----------------------------------------------------------------------------------------------------
  8506.         ''' <summary>
  8507.         ''' Gets a <see cref="EnvironmentUtil.Theming.ThemeInfo"/> object that contains the info of the current windows theme.
  8508.         ''' </summary>
  8509.         ''' ----------------------------------------------------------------------------------------------------
  8510.         ''' <returns>
  8511.         ''' A <see cref="EnvironmentUtil.Theming.ThemeInfo"/> object that contains the info of the current windows theme.
  8512.         ''' </returns>
  8513.         ''' ----------------------------------------------------------------------------------------------------
  8514.         <DebuggerStepThrough>
  8515.         Private Shared Function GetCurrentThemeInfo() As EnvironmentUtil.Theming.ThemeInfo
  8516.  
  8517.             Dim bufferLength As Integer = 260
  8518.  
  8519.             Dim sbFilepath As New StringBuilder(capacity:=bufferLength)
  8520.             Dim sbColorSchemeName As New StringBuilder(capacity:=bufferLength)
  8521.             Dim sbSizeName As New StringBuilder(capacity:=bufferLength)
  8522.  
  8523.             EnvironmentUtil.NativeMethods.GetCurrentThemeName(sbFilepath, bufferLength,
  8524.                                                               sbColorSchemeName, bufferLength,
  8525.                                                               sbSizeName, bufferLength)
  8526.  
  8527.             Return New EnvironmentUtil.Theming.ThemeInfo(filepath:=sbFilepath.ToString,
  8528.                                                          colorSchemeName:=sbColorSchemeName.ToString,
  8529.                                                          sizeName:=sbSizeName.ToString)
  8530.  
  8531.         End Function
  8532.  
  8533. #End Region
  8534.  
  8535.     End Class
  8536.  
  8537. #End Region
  8538.  
  8539. #End Region
  8540.  
  8541. End Class
  8542.  
  8543. #End Region
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement