You can use FindWindow as in this code to check if a program (with window caption "XYZ") is already loaded. If it is it swaps focus to that instance and then ends. You also have to declare functions for ShowWindow and BringWindowToTop



Dim rval As Long
Dim findhwnd As Long
Dim strNull As String

findhwnd = FindWindow(strNull, "XYZ")
If findhwnd <> 0 Then
rval = ShowWindow(findhwnd, 1)
rval = BringWindowToTop(findhwnd)
End
End If