2

私のアプリは、起動時にすでに実行されているかどうかを確認して確認する必要があるため、2回目に開かないようにする必要があります。アプリケーションを表示できるシステム トレイ アイコンがある = False。よく働く。ただし、アプリが既に実行されている場合は、ユーザーが通知アイコンのシステム トレイを確認する必要があります。

Private Sub mainWindowSmall_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim p() As Process
        p = Process.GetProcessesByName("TSC Tool Box")
        If p.Count > 0 Then
            MessageBox.Show("The TSC Tool Box is already running. Check System tray!", _
            "Warning !!!", MessageBoxButtons.OK, _
            MessageBoxIcon.Error, MessageBoxDefaultButton.Button2)
            Me.Close()
        Else
            totalOnLoad()
        End If
    End Sub

VB.NET | ウィンフォーム

4

1 に答える 1