Gruß
Erwin
Function CreateToolhelp32Snapshot Lib "Kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare
Function Process32First Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare
Function Process32Next Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare
Sub CloseHandle Lib "Kernel32" (ByVal hPass As Long)
Sub teste_mal()
Dim hSnapShot As Long, uProcess As PROCESSENTRY32, strPro As String, bolOpen As Boolean
hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0&)
uProcess.dwSize = Len(uProcess)
r = Process32First(hSnapShot, uProcess)
Do While r
strPro = Left$(uProcess.szExeFile, IIf(InStr(1, uProcess.szExeFile, Chr$(0)) > 0, InStr(1, uProcess.szExeFile, Chr$(0)) - 1, 0))
r = Process32Next(hSnapShot, uProcess)
If UCase(strPro) = "MSIMN.EXE" Then
MsgBox "Outlook Express ist geöffnet!"
bolOpen = True
Exit Do
End If
Loop
CloseHandle hSnapShot
If Not bolOpen Then
MsgBox "Outlook Express ist noch nicht geöffnet!"
End If
End Sub
Gruß K.Rola