Ovo nije bas na nivou funkcije, ali je na nivou komponente (ocx, dll, ...)
Code:
Private Type MODULEENTRY32
dwSize As Long
th32ModuleID As Long
th32ProcessID As Long
GlblcntUsage As Long
ProccntUsage As Long
modBaseAddr As Long
modBaseSize As Long
hModule As Long
szModule As String * 256
szExePath As String * 260
End Type
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" _
(ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function Module32First Lib "kernel32" _
(ByVal hSnapshot As Long, uProcess As MODULEENTRY32) As Long
Private Declare Function Module32Next Lib "kernel32" _
(ByVal hSnapshot As Long, uProcess As MODULEENTRY32) As Long
Private Sub Form_Load()
'example created by Scheuren Andy (
[email protected])
Dim uProcess As MODULEENTRY32
Me.AutoRedraw = True
lProcessID = GetCurrentProcessId
hSnapshot = CreateToolhelp32Snapshot(8, 0)
uProcess.dwSize = Len(uProcess)
n = Module32First(hSnapshot, uProcess)
Do While n
Me.Print Left(uProcess.szModule, InStr(uProcess.szModule, Chr(0)) - 1)
n = Module32Next(hSnapshot, uProcess)
Loop
End Sub