Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Integer
'Here SCICALC is the window class name DIM HCALCWND as INTEGER = FINDWINDOW ("Scicalc", "Calculator")
IF hcalcwnd = 0 Then shell ("calc.exe", appwinstyle.normalfocus) Else BringWindowtotop (HCALCWND) END IF