Do modulu vlož deklarace
'běžící procesy
Public Declare Function CreateToolhelp32Snapshot Lib "KERNEL32.DLL" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Public Declare Function Process32First Lib "KERNEL32.DLL" (ByVal hSnapshot As Long, ByRef lppe As LPPROCESSENTRY32) As Long
Public Declare Function Process32Next Lib "KERNEL32.DLL" (ByVal hSnapshot As Long, ByRef lppe As LPPROCESSENTRY32) As Long
Public Const TH32CS_SNAPPROCESS As Long = &H2
Type LPPROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
TH32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szExeFile As String * 260
End Type
např. do Command1_click vlož
Dim hSnap As Long, Proc As LPPROCESSENTRY32, ret As Long
Dim Jmeno_Procesu As String
hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
If hSnap <> 0 Then
Proc.dwSize = Len(Proc)
ret = Process32First(hSnap, Proc)
Do While ret
Jmeno_Procesu = Proc.szExeFile
ret = Process32Next(hSnap, Proc)
Loop
End If
funkce v cyklu vypíše právě běžící procesy - ovšem který běžící proces využívá právě tvou DLL, to zjistit neumí
|