ByVal hSnapShot As Long, _ lppe As PROCESSENTRY32 _ ) As Long Public Declare Function Process32Next Lib kernel32 ( _ ByVal hSnapShot As Long, _ lppe As PROCESSENTRY32 _ ) As Long Public Type PROCESSENTRY32 dwSize As Long cntUsage As Long th32ProcessID As Long ' process ID th32DefaultHeapID As Long th32ModuleID As Long ' only for Toolhelp functions cntThreads As Long ' number of threads th32ParentProcessID As Long ' process ID of parent pcPriClassBase As Long dwFlags As Long szExeFile As String * MAX_PATH ' path/file of EXE file End Type Declare Function CloseHandle Lib kernel32 (ByVal hObject As Long) _ As Long ' -------------------------- Function GetWin95ProcessID(sFQName As String, sName As String, _ ByRef cMatches As Long) As Long ' ************************* ' NOTE: Windows 95/98 only ' ************************* ' Gets the process ID ' If sFQName <> then uses this to get matches ' If sName <> uses just the name to get matches ' Returns 0 if no such process, else the process ID of the last match ' Returns count of matches in OUT parameter cMatches ' Returns FQName if that is empty ' Returns -1 if could not get snapshot Dim i As Integer, c As Currency Dim hSnapShot As Long Dim lret As Long ' for generic return values Dim cProcesses As Long Dim cProcessIDs() As Currency Dim sEXENames() As String Dim sFQEXENames() As String Dim procEntry As PROCESSENTRY32 procEntry.dwSize = LenB(procEntry) |