Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21273

An api to Check if a certain .EXE is open ? and a API LIST ?

$
0
0
Hello !
Since i started programming in vb6 this forum as been MORE than usefull....haha
thanks to everybody.
Ok so,

1 - Im looking for an api to Know if a certain .exe is running, i had this code but i dont like it.

Code:

'-------------------------------------------------------in a module
Dim ass, ess
Public Function isRunning(ByVal Process As String) As Boolean
Set ass = GetObject("winmgmts:")
Set ess = ass.ExecQuery("Select * from Win32_Process where name='" & Process & "'")
On Error Resume Next
If ess.Count Then
isRunning = True
Else
isRunning = False
End If
End Function

' ---------------------------------- in a commandbutton
If isrunning("notepad.exe") = true then
Msgbox "Notepad is open, and now your going to die, :) !!!"
end if

2 - I know this exist, But, do you guys use a certain Program with a list of all api ? and description?
That would be more than usefull !!!

Thanks again !

Viewing all articles
Browse latest Browse all 21273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>