@@ -45,8 +45,8 @@ Friend Class Config
4545 P = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\" & Application.ProductName
4646 End If
4747 Else
48- 'P = Application.StartupPath
49- P = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\" & Application.ProductName
48+ 'P = Application.StartupPath
49+ P = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\" & Application.ProductName
5050 End If
5151
5252 If Not IO.Directory.Exists(P) Then
@@ -69,6 +69,9 @@ Friend Class Config
6969 Public AUTH_ADDRESS As String
7070 Public NOTIFY_TIMEOUT As Int32
7171 Public AUTO_LOGIN As Boolean = True
72+ Public PARAM_CHECK As Boolean = False
73+ Public PARAM_MODE As String
74+ Public POPUP_POS As Int32 = 0
7275
7376 Public Commands As Hashtable = New Hashtable
7477 Public LANGUAGE As String = "default"
@@ -110,6 +113,9 @@ Friend Class Config
110113 "AUTH_ADDRESS=" & Me .AUTH_ADDRESS & vbCrLf &
111114 "NOTIFY_TIMEOUT=" & Me .NOTIFY_TIMEOUT & vbCrLf &
112115 "AUTO_LOGIN=" & CStr (IIf( Me .AUTO_LOGIN, "1" , "0" )) & vbCrLf &
116+ "PARAM_CHECK=" & CStr (IIf( Me .PARAM_CHECK, "1" , "0" )) & vbCrLf &
117+ "PARAM_MODE=" & Me .PARAM_MODE & vbCrLf &
118+ "POPUP_POS=" & Me .POPUP_POS & vbCrLf &
113119 "LANGUAGE=" & Me .LANGUAGE & vbCrLf &
114120 "HOTKEY_MOD_SPEED_DIAL=" & Me .HOTKEY_MOD_SPEED_DIAL & vbCrLf &
115121 "HOTKEY_MOD_REDIAL=" & Me .HOTKEY_MOD_REDIAL & vbCrLf &
@@ -160,6 +166,7 @@ Friend Class Config
160166 Dim RD As Boolean
161167 Dim HKSD As Boolean
162168 Dim HKRD As Boolean
169+ Dim P_POS As Boolean
163170
164171 For I As Integer = 0 To Par.Length - 1
165172 Key = Trim(Par(I)) '.ToUpper
@@ -189,6 +196,16 @@ Friend Class Config
189196 ElseIf Key .StartsWith( "AUTO_LOGIN=" ) Then
190197 Me .AUTO_LOGIN = (Val = "1" )
191198 X += 1
199+ ElseIf Key .StartsWith( "PARAM_CHECK=" ) Then
200+ Me .PARAM_CHECK = (Val = "1" )
201+ X += 1
202+ ElseIf Key .StartsWith( "PARAM_MODE=" ) Then
203+ Me .PARAM_MODE = Val
204+ X += 1
205+ ElseIf Key .StartsWith( "POPUP_POS=" ) Then
206+ P_POS = True
207+ Me .POPUP_POS = CInt (Val)
208+ X += 1
192209 ElseIf Key .StartsWith( "LANGUAGE=" ) Then
193210 Me .LANGUAGE = Val
194211 X += 1
@@ -251,6 +268,10 @@ Friend Class Config
251268 Me .HOTKEY_MOD_SPEED_DIAL = &H2 'CTRL
252269 End If
253270
271+ If Not (P_POS) Then
272+ Me .POPUP_POS = 8
273+ End If
274+
254275 _IsSaved = (X = 8 )
255276 End If
256277
@@ -517,7 +538,7 @@ Friend Class Helper
517538
518539 Try
519540 ' Open the access token of the current process with TOKEN_QUERY.
520- If ( Not NativeMethods.OpenProcessToken(Process.GetCurrentProcess.Handle, _
541+ If ( Not NativeMethods.OpenProcessToken(Process.GetCurrentProcess.Handle,
521542 NativeMethods.TOKEN_QUERY, hToken)) Then
522543 Throw New Win32Exception
523544 End If
@@ -530,8 +551,8 @@ Friend Class Helper
530551 End If
531552
532553 ' Retrieve token elevation information.
533- If ( Not NativeMethods.GetTokenInformation(hToken, _
534- TOKEN_INFORMATION_CLASS.TokenElevation, _
554+ If ( Not NativeMethods.GetTokenInformation(hToken,
555+ TOKEN_INFORMATION_CLASS.TokenElevation,
535556 pTokenElevation, cbTokenElevation, cbTokenElevation)) Then
536557 Throw New Win32Exception
537558 End If
@@ -630,18 +651,18 @@ Friend Class Enums
630651 TokenElevationTypeLimited
631652 End Enum
632653
633- <StructLayout(LayoutKind.Sequential)> _
654+ <StructLayout(LayoutKind.Sequential)>
634655 Friend Structure SID_AND_ATTRIBUTES
635656 Public Sid As IntPtr
636657 Public Attributes As UInteger
637658 End Structure
638659
639- <StructLayout(LayoutKind.Sequential)> _
660+ <StructLayout(LayoutKind.Sequential)>
640661 Friend Structure TOKEN_ELEVATION
641662 Public TokenIsElevated As Integer
642663 End Structure
643664
644- <StructLayout(LayoutKind.Sequential)> _
665+ <StructLayout(LayoutKind.Sequential)>
645666 Friend Structure TOKEN_MANDATORY_LABEL
646667 Public Label As SID_AND_ATTRIBUTES
647668 End Structure
@@ -659,7 +680,7 @@ Friend Class SafeTokenHandle
659680 MyBase .SetHandle(handle)
660681 End Sub
661682
662- <DllImport( "kernel32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )> _
683+ <DllImport( "kernel32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )>
663684 Friend Shared Function CloseHandle( ByVal handle As IntPtr) As Boolean
664685 End Function
665686
@@ -685,9 +706,9 @@ Friend Class NativeMethods
685706 Public Const TOKEN_ADJUST_DEFAULT As UInt32 = &H80
686707 Public Const TOKEN_ADJUST_SESSIONID As UInt32 = &H100
687708 Public Const TOKEN_READ As UInt32 = (STANDARD_RIGHTS_READ Or TOKEN_QUERY)
688- Public Const TOKEN_ALL_ACCESS As UInt32 = (STANDARD_RIGHTS_REQUIRED Or _
689- TOKEN_ASSIGN_PRIMARY Or TOKEN_DUPLICATE Or TOKEN_IMPERSONATE Or _
690- TOKEN_QUERY Or TOKEN_QUERY_SOURCE Or TOKEN_ADJUST_PRIVILEGES Or _
709+ Public Const TOKEN_ALL_ACCESS As UInt32 = (STANDARD_RIGHTS_REQUIRED Or
710+ TOKEN_ASSIGN_PRIMARY Or TOKEN_DUPLICATE Or TOKEN_IMPERSONATE Or
711+ TOKEN_QUERY Or TOKEN_QUERY_SOURCE Or TOKEN_ADJUST_PRIVILEGES Or
691712 TOKEN_ADJUST_GROUPS Or TOKEN_ADJUST_DEFAULT Or TOKEN_ADJUST_SESSIONID)
692713
693714
@@ -702,45 +723,45 @@ Friend Class NativeMethods
702723 Public Const SECURITY_MANDATORY_HIGH_RID As Integer = &H3000
703724 Public Const SECURITY_MANDATORY_SYSTEM_RID As Integer = &H4000
704725
705- <DllImport( "advapi32" , CharSet:=CharSet.Auto, SetLastError:= True )> _
706- Public Shared Function OpenProcessToken( _
707- ByVal hProcess As IntPtr, _
708- ByVal desiredAccess As UInt32, _
726+ <DllImport( "advapi32" , CharSet:=CharSet.Auto, SetLastError:= True )>
727+ Public Shared Function OpenProcessToken(
728+ ByVal hProcess As IntPtr,
729+ ByVal desiredAccess As UInt32,
709730 < Out ()> ByRef hToken As SafeTokenHandle) _
710731 As <MarshalAs(UnmanagedType.Bool)> Boolean
711732 End Function
712733
713- <DllImport( "advapi32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )> _
714- Public Shared Function DuplicateToken( _
715- ByVal ExistingTokenHandle As SafeTokenHandle, _
716- ByVal ImpersonationLevel As SECURITY_IMPERSONATION_LEVEL, _
734+ <DllImport( "advapi32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )>
735+ Public Shared Function DuplicateToken(
736+ ByVal ExistingTokenHandle As SafeTokenHandle,
737+ ByVal ImpersonationLevel As SECURITY_IMPERSONATION_LEVEL,
717738 < Out ()> ByRef DuplicateTokenHandle As SafeTokenHandle) _
718739 As Boolean
719740 End Function
720741
721- <DllImport( "advapi32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )> _
722- Public Shared Function GetTokenInformation( _
723- ByVal hToken As SafeTokenHandle, _
724- ByVal tokenInfoClass As TOKEN_INFORMATION_CLASS, _
725- ByVal pTokenInfo As IntPtr, _
726- ByVal tokenInfoLength As Integer , _
742+ <DllImport( "advapi32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )>
743+ Public Shared Function GetTokenInformation(
744+ ByVal hToken As SafeTokenHandle,
745+ ByVal tokenInfoClass As TOKEN_INFORMATION_CLASS,
746+ ByVal pTokenInfo As IntPtr,
747+ ByVal tokenInfoLength As Integer ,
727748 < Out ()> ByRef returnLength As Integer ) _
728749 As <MarshalAs(UnmanagedType.Bool)> Boolean
729750 End Function
730751
731752 Public Const BCM_SETSHIELD As UInt32 = &H160C
732- <DllImport( "user32" , CharSet:=CharSet.Auto, SetLastError:= True )> _
733- Public Shared Function SendMessage( _
734- ByVal hWnd As IntPtr, _
735- ByVal Msg As UInt32, _
736- ByVal wParam As Integer , _
753+ <DllImport( "user32" , CharSet:=CharSet.Auto, SetLastError:= True )>
754+ Public Shared Function SendMessage(
755+ ByVal hWnd As IntPtr,
756+ ByVal Msg As UInt32,
757+ ByVal wParam As Integer ,
737758 ByVal lParam As IntPtr) _
738759 As Integer
739760 End Function
740761
741- <DllImport( "advapi32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )> _
742- Public Shared Function GetSidSubAuthority( _
743- ByVal pSid As IntPtr, _
762+ <DllImport( "advapi32.dll" , CharSet:=CharSet.Auto, SetLastError:= True )>
763+ Public Shared Function GetSidSubAuthority(
764+ ByVal pSid As IntPtr,
744765 ByVal nSubAuthority As UInt32) _
745766 As IntPtr
746767 End Function
@@ -756,7 +777,7 @@ Friend Class LinkHelper
756777 Private Enum SLGP_FLAGS
757778 SLGP_SHORTPATH = &H1
758779 SLGP_UNCPRIORITY = &H2
759- SLGP_RAWPATH = &H4
780+ SLGP_RAWPATH = &H4
760781 End Enum
761782
762783 <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)>
0 commit comments