Results 1 to 3 of 3

Thread: Determining if software is loaded on a machine

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    Somerset, NJ
    Posts
    13
    Is there a way to determine if certain software is loaded
    on a machine but not running, using the API.
    ie. Microsoft Excel or Word

    [Edited by lab on 09-22-2000 at 07:56 AM]

  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    240

    Talking Try this

    Const MAX_FILENAME_LEN = 260
    Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
    Private Sub Form_Load()
    Dim i As Integer, s2 As String
    Const sFile = "C:\Windows\whatever.exe"

    'Check if the file exists
    If Dir(sFile) = "" Or sFile = "" Then
    MsgBox "File not found!", vbCritical
    Exit Sub
    End If
    'Create a buffer
    s2 = String(MAX_FILENAME_LEN, 32)
    'Retrieve the name and handle of the executable, associated with this file
    i = FindExecutable(sFile, vbNullString, s2)
    If i > "" Then
    MsgBox Left$(s2, InStr(s2, Chr$(0)) - 1)
    Else
    MsgBox "Exe. Found!"
    End If
    End Sub



    Hope this helps

  3. #3

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    Somerset, NJ
    Posts
    13
    Thanks software FindExecutable will work just fine!


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