Ejemplo de como crear una propiedad con un rango asignado...
Una utilidad para mostrar, ocultar, o intercambiar el estado del escritorio.
Nota: El método ToggleDesktop no funciona en WinXP.
Utilidad para posicionar una ventana en la pantalla, se puede elegir una de las posiciones predeterminadas (las esquinas de la pantalla) o especificar unas coordenadas exactas.
Añade o elimina una aplicación de la sección 'Run' del registro, para iniciar una aplicación cuando el usuario se loguea en Windows.
Obtiene la ruta de un proceso de 64 Bits, desde una aplicación .NET de 32 Bits.
Aviso, es un procedimiento lento, pero por el momento no conozco una mejor manera de lograrlo.
Código (vbnet) [Seleccionar]
Public Class MyType
''' <summary>
''' Gets or sets the value.
''' </summary>
''' <value>The value.</value>
Public Property MyProperty As Integer
Get
Return Me._MyValue
End Get
Set(ByVal value As Integer)
If value < Me._MyValueMin Then
If Me._MyValueThrowRangeException Then
Throw New ArgumentOutOfRangeException("MyValue", Me._MyValueExceptionMessage)
End If
Me._MyValue = Me._MyValueMin
ElseIf value > Me._MyValueMax Then
If Me._MyValueThrowRangeException Then
Throw New ArgumentOutOfRangeException("MyValue", Me._MyValueExceptionMessage)
End If
Me._MyValue = Me._MyValueMax
Else
Me._MyValue = value
End If
End Set
End Property
Private _MyValue As Integer = 0I
Private _MyValueMin As Integer = 0I
Private _MyValueMax As Integer = 10I
Private _MyValueThrowRangeException As Boolean = True
Private _MyValueExceptionMessage As String = String.Format("The valid range is beetwen {0} and {1}",
Me._MyValueMin, Me._MyValueMax)
End Class
Una utilidad para mostrar, ocultar, o intercambiar el estado del escritorio.
Nota: El método ToggleDesktop no funciona en WinXP.
Código (vbnet) [Seleccionar]
' ***********************************************************************
' Author : Elektro
' Last Modified On : 09-23-2014
' ***********************************************************************
' <copyright file="DesktopVisibility.vb" company="Elektro Studios">
' Copyright (c) Elektro Studios. All rights reserved.
' </copyright>
' ***********************************************************************
#Region " Usage Examples "
' DesktopVisibility.ShowDesktop()
' DesktopVisibility.HideDesktop()
' DesktopVisibility.ToggleDesktop()
#End Region
#Region " Imports "
Imports System.Runtime.InteropServices
#End Region
#Region " DesktopVisibility "
''' <summary>
''' Shows, hides, or toggles the desktop.
''' </summary>
Public NotInheritable Class DesktopVisibility
#Region " Objects "
''' <summary>
''' "Shell" CLASSID.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/bb776890%28v=vs.85%29.aspx
''' </summary>
Private Shared ReadOnly CLSIDShell As New Guid("13709620-C279-11CE-A49E-444553540000")
''' <summary>
''' Gets the objects in the Shell.
''' Methods are provided to control the Shell and to execute commands within the Shell.
''' There are also methods to obtain other Shell-related objects.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/bb774094%28v=vs.85%29.aspx
''' </summary>
Private Shared ReadOnly Property Shell As Object
Get
If _Shell Is Nothing Then
_Shell = Activator.CreateInstance(Type.GetTypeFromCLSID(CLSIDShell))
Return _Shell
Else
Return _Shell
End If
End Get
End Property
Private Shared _Shell As Object = Nothing
#End Region
#Region " P/Invoke "
#Region " Methods "
''' <summary>
''' Retrieves a handle to the top-level window whose class name and window name match the specified strings.
''' This function does not search child windows.
''' This function does not perform a case-sensitive search.
''' To search child windows, beginning with a specified child window, use the FindWindowEx function.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499%28v=vs.85%29.aspx
''' </summary>
''' <param name="lpClassName">The class name.
''' If this parameter is NULL, it finds any window whose title matches the lpWindowName parameter.</param>
''' <param name="lpWindowName">The window name (the window's title).
''' If this parameter is NULL, all window names match.</param>
''' <returns>If the function succeeds, the return value is a handle to the window that has the specified class name and window name.
''' If the function fails, the return value is NULL.</returns>
<DllImport("user32.dll", SetLastError:=False)>
Private Shared Function FindWindow(
ByVal lpClassName As String,
ByVal lpWindowName As String
) As IntPtr
End Function
''' <summary>
''' Sends the specified message to a window or windows.
''' The SendMessage function calls the window procedure for the specified window
''' and does not return until the window procedure has processed the message.
''' </summary>
''' <param name="hWnd">A handle to the window whose window procedure will receive the message.</param>
''' <param name="Msg">The message to be sent.</param>
''' <param name="wParam">Additional message-specific information.</param>
''' <param name="lParam">Additional message-specific information.</param>
''' <returns>IntPtr.</returns>
<DllImport("user32.dll", SetLastError:=False)>
Private Shared Function SendMessage(
ByVal hWnd As IntPtr,
ByVal Msg As WindowsMessages,
ByVal wParam As IntPtr,
ByVal lParam As IntPtr
) As IntPtr
End Function
#End Region
#Region " Enumerations "
''' <summary>
''' Specifies a System-Defined Message.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx#system_defined
''' </summary>
Public Enum WindowsMessages
''' <summary>
''' Message sent when the user selects a command item from a menu,
''' when a control sends a notification message to its parent window,
''' or when an accelerator keystroke is translated.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms647591%28v=vs.85%29.aspx
''' </summary>
WM_COMMAND = &H111UI
End Enum
#End Region
#Region " Constants "
''' <summary>
''' Minimize all windows.
''' </summary>
Const MIN_ALL As Integer = 419
''' <summary>
''' Undo the minimization of all minimized windows.
''' </summary>
Const MIN_ALL_UNDO As Integer = 416
#End Region
#End Region
#Region " Public Methods "
''' <summary>
''' Shows the desktop.
''' </summary>
Public Shared Sub ShowDesktop()
SendMessage(FindWindow("Shell_TrayWnd", Nothing),
WindowsMessages.WM_COMMAND,
New IntPtr(MIN_ALL), IntPtr.Zero)
End Sub
''' <summary>
''' Hides the desktop.
''' </summary>
Public Shared Sub HideDesktop()
SendMessage(FindWindow("Shell_TrayWnd", Nothing),
WindowsMessages.WM_COMMAND,
New IntPtr(MIN_ALL_UNDO), IntPtr.Zero)
End Sub
''' <summary>
''' Shows or hides the desktop.
''' </summary>
Public Shared Sub ToggleDesktop()
Shell.ToggleDesktop() ' Doesns't works in Windows XP
End Sub
#End Region
End Class
#End Region
Utilidad para posicionar una ventana en la pantalla, se puede elegir una de las posiciones predeterminadas (las esquinas de la pantalla) o especificar unas coordenadas exactas.
Código (vbnet) [Seleccionar]
' ***********************************************************************
' Author : Elektro
' Last Modified On : 10-01-2014
' ***********************************************************************
' <copyright file="SetWindowPosition.vb" company="Elektro Studios">
' Copyright (c) Elektro Studios. All rights reserved.
' </copyright>
' ***********************************************************************
#Region " Example Usage "
' SetWindowPosition.SetWindowPos("proceso.exe", SetWindowPosition.Corner.BottomRight)
' SetWindowPosition.SetWindowPos("proceso.exe", X:=100, Y:=100, Bounds:=SystemInformation.VirtualScreen)
#End Region
#Region " Imports "
Imports System.ComponentModel
Imports System.Runtime.InteropServices
#End Region
''' <summary>
''' Set the position of a window.
''' </summary>
Public Class SetWindowPosition
#Region " P/Invoke "
''' <summary>
''' Platform Invocation methods (P/Invoke), access unmanaged code.
''' This class does not suppress stack walks for unmanaged code permission.
''' <see cref="System.Security.SuppressUnmanagedCodeSecurityAttribute"/> must not be applied to this class.
''' This class is for methods that can be used anywhere because a stack walk will be performed.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/ms182161.aspx
''' </summary>
Protected NotInheritable Class NativeMethods
#Region " Methods "
''' <summary>
''' Changes the size, position, and Z order of a child, pop-up, or top-level window.
''' These windows are ordered according to their appearance on the screen.
''' The topmost window receives the highest rank and is the first window in the Z order.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545%28v=vs.85%29.aspx
''' </summary>
''' <param name="hWnd">
''' A handle to the window.
''' </param>
''' <param name="hWndInsertAfter">
''' A special handle to the window to precede the positioned window in the Z order.
''' This parameter must be a window handle or one of the <see cref="SpecialWindowHandles"/> values.
''' </param>
''' <param name="X">
''' The new position of the left side of the window, in client coordinates.
''' </param>
''' <param name="Y">
''' The new position of the top of the window, in client coordinates.
''' </param>
''' <param name="cx">
''' The new width of the window, in pixels.
''' </param>
''' <param name="cy">
''' The new height of the window, in pixels.
''' </param>
''' <param name="uFlags">
''' The window sizing and positioning flags.
''' </param>
''' <returns><c>true</c> if the function succeeds, <c>false</c> otherwise.</returns>
<DllImport("user32.dll", SetLastError:=True)>
Friend Shared Function SetWindowPos(
ByVal hWnd As IntPtr,
ByVal hWndInsertAfter As SpecialWindowHandles,
ByVal X As Integer,
ByVal Y As Integer,
ByVal cx As Integer,
ByVal cy As Integer,
ByVal uFlags As SetWindowPosFlags
) As Boolean
End Function
''' <summary>
''' Retrieves the dimensions of the bounding rectangle of the specified window.
''' The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519%28v=vs.85%29.aspx
''' </summary>
''' <param name="hWnd">A handle to the window.</param>
''' <param name="rc">
''' A pointer to a RECT structure that receives the screen coordinates of
''' the upper-left and lower-right corners of the window.
''' </param>
''' <returns><c>true</c> if the function succeeds, <c>false</c> otherwise.</returns>
<DllImport("user32.dll", SetLastError:=True)>
Friend Shared Function GetWindowRect(
ByVal hWnd As IntPtr,
ByRef rc As Rectangle
) As Boolean
End Function
#End Region
#Region " Enumerations "
''' <summary>
''' Specifies the window sizing and positioning flags.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545%28v=vs.85%29.aspx
''' </summary>
<Description("Enum used as 'uFlags' parameter of 'NativeMethods.SetWindowPos' function")>
<Flags>
Friend Enum SetWindowPosFlags As UInteger
''' <summary>
''' If the calling thread and the thread that owns the window are attached to different input queues,
''' the system posts the request to the thread that owns the window.
''' This prevents the calling thread from blocking its execution while other threads process the request.
''' </summary>
''' <remarks>SWP_ASYNCWINDOWPOS</remarks>
SynchronousWindowPosition = &H4000UI
''' <summary>
''' Prevents generation of the WM_SYNCPAINT message.
''' </summary>
''' <remarks>SWP_DEFERERASE</remarks>
DeferErase = &H2000UI
''' <summary>
''' Draws a frame (defined in the window's class description) around the window.
''' </summary>
''' <remarks>SWP_DRAWFRAME</remarks>
DrawFrame = &H20UI
''' <summary>
''' Applies new frame styles set using the SetWindowLong function.
''' Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed.
''' If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
''' </summary>
''' <remarks>SWP_FRAMECHANGED</remarks>
FrameChanged = &H20UI
''' <summary>
''' Hides the window.
''' </summary>
''' <remarks>SWP_HIDEWINDOW</remarks>
HideWindow = &H80UI
''' <summary>
''' Does not activate the window.
''' If this flag is not set, the window is activated and moved to the top of
''' either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
''' </summary>
''' <remarks>SWP_NOACTIVATE</remarks>
DoNotActivate = &H10UI
''' <summary>
''' Discards the entire contents of the client area. If this flag is not specified,
''' the valid contents of the client area are saved and copied back into the
''' client area after the window is sized or repositioned.
''' </summary>
''' <remarks>SWP_NOCOPYBITS</remarks>
DoNotCopyBits = &H100UI
''' <summary>
''' Retains the current position (ignores X and Y parameters).
''' </summary>
''' <remarks>SWP_NOMOVE</remarks>
IgnoreMove = &H2UI
''' <summary>
''' Does not change the owner window's position in the Z order.
''' </summary>
''' <remarks>SWP_NOOWNERZORDER</remarks>
DoNotChangeOwnerZOrder = &H200UI
''' <summary>
''' Does not redraw changes.
''' If this flag is set, no repainting of any kind occurs.
''' This applies to the client area, the nonclient area (including the title bar and scroll bars),
''' and any part of the parent window uncovered as a result of the window being moved.
''' When this flag is set, the application must explicitly invalidate or
''' redraw any parts of the window and parent window that need redrawing.
''' </summary>
''' <remarks>SWP_NOREDRAW</remarks>
DoNotRedraw = &H8UI
''' <summary>
''' Same as the SWP_NOOWNERZORDER flag.
''' </summary>
''' <remarks>SWP_NOREPOSITION</remarks>
DoNotReposition = &H200UI
''' <summary>
''' Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
''' </summary>
''' <remarks>SWP_NOSENDCHANGING</remarks>
DoNotSendChangingEvent = &H400UI
''' <summary>
''' Retains the current size (ignores the cx and cy parameters).
''' </summary>
''' <remarks>SWP_NOSIZE</remarks>
IgnoreResize = &H1UI
''' <summary>
''' Retains the current Z order (ignores the hWndInsertAfter parameter).
''' </summary>
''' <remarks>SWP_NOZORDER</remarks>
IgnoreZOrder = &H4UI
''' <summary>
''' Displays the window.
''' </summary>
''' <remarks>SWP_SHOWWINDOW</remarks>
ShowWindow = &H40UI
End Enum
''' <summary>
''' Specifies a special handle to the window to precede the positioned window in the Z order.
''' MSDN Documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633545%28v=vs.85%29.aspx
''' </summary>
<Description("Enum used as 'hWndInsertAfter' parameter of 'NativeMethods.SetWindowPos' function")>
Friend Enum SpecialWindowHandles As Integer
''' <summary>
''' Places the window at the top of the Z order.
''' </summary>
Top = 0I
''' <summary>
''' Places the window at the bottom of the Z order.
''' If the hWnd parameter identifies a topmost window,
''' the window loses its topmost status and is placed at the bottom of all other windows.
''' </summary>
Bottom = 1I
''' <summary>
''' Places the window above all non-topmost windows.
''' The window maintains its topmost position even when it is deactivated.
''' </summary>
TopMost = -1I
''' <summary>
''' Places the window above all non-topmost windows (that is, behind all topmost windows).
''' This flag has no effect if the window is already a non-topmost window.
''' </summary>
NoTopMost = -2I
End Enum
#End Region
End Class
#End Region
#Region " Enumerations "
''' <summary>
''' Specifies a screen corner.
''' </summary>
<Description("Enum used as 'Corner' parameter of 'SetWindowPos' function")>
Friend Enum Corner As Integer
''' <summary>
''' Top-Left screen corner.
''' </summary>
TopLeft = 0I
''' <summary>
''' Top-Right screen corner.
''' </summary>
TopRight = 1I
''' <summary>
''' Bottom-Left screen corner.
''' </summary>
BottomLeft = 2I
''' <summary>
''' Bottom-Right screen corner.
''' </summary>0
BottomRight = 3I
End Enum
#End Region
#Region " Public Methods "
''' <summary>
''' Set the position of a window.
''' </summary>
''' <param name="ProcessName">The process name.</param>
''' <param name="Corner">The new window position, a screen corner.</param>
''' <param name="Bounds">
''' The screen <see cref="Rectangle"/> where the window is shown.
''' If this parameter is empty, <see cref="Screen.PrimaryScreen"/> is used as default.
''' </param>
Friend Shared Sub SetWindowPos(ByVal ProcessName As String,
ByVal Corner As Corner,
Optional ByVal Bounds As Rectangle = Nothing)
Dim Rect As Rectangle ' The specified screen bounds
Dim HWND As IntPtr ' The process main window handle.
Dim Width As Integer ' The process window width.
Dim Height As Integer ' The process window height.
Dim x As Integer
Dim y As Integer
If Bounds.IsEmpty Then
Bounds = Screen.PrimaryScreen.WorkingArea
End If
' Iterate the process instances.
For Each p As Process In Process.GetProcessesByName(FixProcessName(ProcessName))
Try
' Get the main window handle.
HWND = p.MainWindowHandle
' Copy the process window position and size into the Rectangle.
' NOTE: This is not a bad practice, but 'GetWindowRect' function should use a Windows API 'RECT' structure.
NativeMethods.GetWindowRect(HWND, Rect)
Width = (Rect.Width - Rect.Left) ' Set the window width
Height = (Rect.Height - Rect.Top) ' Set the window height
Select Case Corner
Case SetWindowPosition.Corner.TopLeft
x = Bounds.Left
y = Bounds.Top
Case SetWindowPosition.Corner.TopRight
x = Bounds.Right - Width
y = Bounds.Top
Case SetWindowPosition.Corner.BottomLeft
x = Bounds.Left
y = Bounds.Bottom - Height
Case SetWindowPosition.Corner.BottomRight
x = Bounds.Right - Width
y = Bounds.Bottom - Height
End Select
' Move the Main Window.
NativeMethods.SetWindowPos(HWND, New IntPtr(NativeMethods.SpecialWindowHandles.NoTopMost),
x, y, 0, 0,
NativeMethods.SetWindowPosFlags.IgnoreResize)
Catch ex As Exception
Throw
End Try
Next
End Sub
''' <summary>
''' Set the position of a window.
''' </summary>
''' <param name="ProcessName">The process name.</param>
''' <param name="X">The new X coordinate.</param>
''' <param name="Y">The new Y coordinate.</param>
''' <param name="Bounds">
''' The screen <see cref="Rectangle"/> where the window is shown.
''' If this parameter is empty, <see cref="Screen.PrimaryScreen"/> is used as default.
''' </param>
Friend Shared Sub SetWindowPos(ByVal ProcessName As String,
ByVal X As Integer,
ByVal Y As Integer,
Optional ByVal Bounds As Rectangle = Nothing)
Dim Rect As Rectangle ' The specified screen bounds
Dim HWND As IntPtr ' The process main window handle.
Dim Width As Integer ' The process window width.
Dim Height As Integer ' The process window height.
If Bounds.IsEmpty Then
Bounds = Screen.PrimaryScreen.WorkingArea
End If
' Iterate the process instances.
For Each p As Process In Process.GetProcessesByName(FixProcessName(ProcessName))
Try
' Get the main window handle.
HWND = p.MainWindowHandle
' Copy the process window position and size into the Rectangle.
' NOTE: This is not a bad practice, but 'GetWindowRect' function should use a Windows API 'RECT' structure.
NativeMethods.GetWindowRect(HWND, Rect)
Width = (Rect.Width - Rect.Left) ' Set the window width
Height = (Rect.Height - Rect.Top) ' Set the window height
' Move the Main Window.
NativeMethods.SetWindowPos(HWND, New IntPtr(NativeMethods.SpecialWindowHandles.NoTopMost),
x, y, 0, 0,
NativeMethods.SetWindowPosFlags.IgnoreResize)
Catch ex As Exception
Throw
End Try
Next
End Sub
#End Region
#Region " Private Methods "
''' <summary>
''' Fixes the name of a process.
''' </summary>
''' <param name="name">The process name.</param>
''' <returns>System.String.</returns>
Private Shared Function FixProcessName(ByVal name As String) As String
If name.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) Then
Return name.Remove(name.Length - ".exe".Length)
Else
Return name
End If
End Function
#End Region
End Class
Añade o elimina una aplicación de la sección 'Run' del registro, para iniciar una aplicación cuando el usuario se loguea en Windows.
Código (vbnet) [Seleccionar]
' Add or remove application from Windows Startup
' ( By Elektro )
'
' Usage Examples :
' AddApplicationToWindowsStartup(User.CurrentUser, Application.ProductName, Application.ExecutablePath)
' RemoveApplicationFromWindowsStartup(User.CurrentUser, pplication.ProductName)
''' <summary>
''' Specifies a registry user session.
''' </summary>
Public Enum User As Integer
''' <summary>
''' The current user session.
''' </summary>
CurrentUser = 1I
''' <summary>
''' All user sessions.
''' </summary>
AllUsers = 2I
End Enum
''' <summary>
''' Adds an application to Windows Startup.
''' </summary>
''' <param name="User">Indicates the registry root key.</param>
''' <param name="Title">Indicates the registry value name.</param>
''' <param name="FilePath">Indicates the registry value data.</param>
Friend Shared Sub AddApplicationToWindowsStartup(ByVal User As User,
ByVal Title As String,
ByVal FilePath As String)
Try
Select Case User
Case User.CurrentUser
My.Computer.Registry.CurrentUser.
OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", writable:=True).
SetValue(Title, FilePath, Microsoft.Win32.RegistryValueKind.String)
Case User.AllUsers
My.Computer.Registry.LocalMachine.
OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", writable:=True).
SetValue(Title, FilePath, Microsoft.Win32.RegistryValueKind.String)
Case Else
Exit Select
End Select
Catch ex As Exception
Throw
End Try
End Sub
''' <summary>
''' Removes an application from Windows Startup.
''' </summary>
''' <param name="User">Indicates the registry root key.</param>
''' <param name="Title">Indicates the registry value name.</param>
Friend Shared Sub RemoveApplicationFromWindowsStartup(ByVal User As User,
ByVal Title As String)
Try
Select Case User
Case User.CurrentUser
My.Computer.Registry.CurrentUser.
OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", writable:=True).
DeleteValue(Title, throwOnMissingValue:=False)
Case User.AllUsers
My.Computer.Registry.LocalMachine.
OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", writable:=True).
DeleteValue(Title, throwOnMissingValue:=False)
Case Else
Exit Select
End Select
Catch ex As Exception
Throw
End Try
End Sub
Obtiene la ruta de un proceso de 64 Bits, desde una aplicación .NET de 32 Bits.
Aviso, es un procedimiento lento, pero por el momento no conozco una mejor manera de lograrlo.
Código (vbnet) [Seleccionar]
' Get x64 Process Path From x86
' ( By Elektro )
'
' Instructions:
' 1. Add a reference to 'System.Management'
'
' Usage Examples:
' Dim path As String = GetX64ProcessPathFromX86("conhost.exe")
'
''' <summary>
''' Gets the process path of an x64 process from an x86 .NET application.
''' </summary>
''' <param name="ProcessName">Indicates the name of the process.</param>
''' <returns>The process path.</returns>
Friend Shared Function GetX64ProcessPathFromX86(ByVal ProcessName As String) As String
Dim wmiQuery As String = String.Format("SELECT ExecutablePath FROM Win32_Process Where Name = '{0}.exe'",
If(ProcessName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase),
ProcessName.Remove(ProcessName.Length - ".exe".Length),
ProcessName))
Using searcher As New ManagementObjectSearcher(queryString:=wmiQuery)
Using results As ManagementObjectCollection = searcher.[Get]
If results.Count <> 0I Then
Return DirectCast(DirectCast(results(0I), ManagementBaseObject).
Properties("ExecutablePath").Value, String)
Else
Return String.Empty
End If
End Using
End Using
End Function