Results 1 to 2 of 2

Thread: App Running - Closing Objects

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    3

    App Running - Closing Objects

    2 part Question
    Is there an easy way to determine is a particular app is running. I wish for some options to change in my dll depending if certain apps are running.

    Secondly, Is it possible to list objects that are currently running and then being able to close selected ones. For example I use vbscript to create 3 different objects from my dll. Is it possible to release the objects fully. (Set obj1 = Nothing) doesn't always work.
    If I create 3 objects:
    Eg Set Obj1 = CreateObject("mydll.class1")
    Set obj2 = CreateObject("mydll.class2)
    set obj3 = CreateObject("mydll.class3)
    Then be able to list obj1, obj2, obj3 etc
    and then be able to kill obj2 or kill all instance and links to mydll

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Feed this the caption of the application you are looking for.
    VB Code:
    1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    2.  
    3. Private Sub Command1_Click()
    4.     Dim WinWnd As Long
    5.     WinWnd = FindWindow(vbNullString, "Calculator")
    6.     If WinWnd = 0 Then
    7.        MsgBox "Calculator Not Running"
    8.     Else
    9.        MsgBox "Calculator Is Running"
    10.     End If
    11. End Sub

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