VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Determine the executable associated with an application

by C.J. (13 Submissions)
Category: Windows System Services
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Tue 2nd March 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Determine the executable associated with an application

API Declarations


Private Const MAX_FILENAME_LEN = 256


Rate Determine the executable associated with an application



'
'  Returns "" if no file is found.
'
Public Function FindExecutable(s As String) As String
   Dim i As Integer
   Dim s2 As String
   
   s2 = String(MAX_FILENAME_LEN, 32) & Chr$(0)
   
   i = FindExecutableA(s & Chr$(0), vbNullString, s2)
   
   If i > 32 Then
      FindExecutable = Left$(s2, InStr(s2, Chr$(0)) - 1)
   Else
      FindExecutable = ""
   End If
   
End Function

Download this snippet    Add to My Saved Code

Determine the executable associated with an application Comments

No comments have been posted about Determine the executable associated with an application. Why not be the first to post a comment about Determine the executable associated with an application.

Post your comment

Subject:
Message:
0/1000 characters