We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e24311c commit bbb2182Copy full SHA for bbb2182
1 file changed
Plain Craft Launcher 2/Application.xaml.vb
@@ -201,11 +201,10 @@ RetryCacheCheck:
201
''' 从文件锁中尝试拖出进程
202
''' </summary>
203
Public Sub DropToTopByLock(LockPath As String)
204
- Dim Content = File.ReadAllBytes(LockPath)
205
Dim Pid As Integer
206
- If Not Integer.TryParse(Encoding.UTF8.GetString(Content), Pid) Then Return
207
- ShowWindowToTop(Process.GetProcessById(Pid).MainWindowHandle)
208
-
+ If Not Integer.TryParse(File.ReadAllText(LockPath), Pid) Then Return
+ Dim Handle = Process.GetProcessById(Pid)?.MainWindowHandle
+ If Handle <> Intptr.Zero ShowWindowToTop(Handle)
209
End Sub
210
211
'结束
0 commit comments