chore: add handle valid check
This commit is contained in:
@@ -201,11 +201,10 @@ RetryCacheCheck:
|
|||||||
''' 从文件锁中尝试拖出进程
|
''' 从文件锁中尝试拖出进程
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Sub DropToTopByLock(LockPath As String)
|
Public Sub DropToTopByLock(LockPath As String)
|
||||||
Dim Content = File.ReadAllBytes(LockPath)
|
|
||||||
Dim Pid As Integer
|
Dim Pid As Integer
|
||||||
If Not Integer.TryParse(Encoding.UTF8.GetString(Content), Pid) Then Return
|
If Not Integer.TryParse(File.ReadAllText(LockPath), Pid) Then Return
|
||||||
ShowWindowToTop(Process.GetProcessById(Pid).MainWindowHandle)
|
Dim Handle = Process.GetProcessById(Pid)?.MainWindowHandle
|
||||||
|
If Handle <> Intptr.Zero ShowWindowToTop(Handle)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'结束
|
'结束
|
||||||
|
|||||||
Reference in New Issue
Block a user