Same question as before, how can i detect is Solitaire is running, i need to know?
Rohan
Printable View
Same question as before, how can i detect is Solitaire is running, i need to know?
Rohan
Code:'you must know the exact title name
'find a running program...calc for this example
'bas module code
Public Declare Function FindWindow Lib "user32.dll" _
Alias "FindWindowA" (ByVal lpClassName As Any, _
ByVal lpWindowName As Any) As Long
'form code
Private Sub Command1_Click()
Dim hwnd As Long ' receives handle to the found window
Dim retval As Long ' generic return value
hwnd = FindWindow(CLng(0), "Calculator") ' look for the window
If hwnd = 0 Then ' could not find the window
MsgBox "Calculator is not running"
Else
MsgBox "Calculator is running"
End If
End Sub