Results 1 to 2 of 2

Thread: Detecting if Solitaire is running?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Wellington NZ
    Posts
    153
    Same question as before, how can i detect is Solitaire is running, i need to know?

    Rohan

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width