Anzeige
Archiv - Navigation
520to524
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
520to524
520to524
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

per VBA ermitteln, wieviele IE-Explorer offen

per VBA ermitteln, wieviele IE-Explorer offen
22.11.2004 14:49:56
Mike
Hallo,
weiß jemand zufällig, wie mir VBA ermitteln kann, wieviele Internet-Explorer Instanzen geöffet sind?
Für Anregungen bedankt sich im Voraus
der Mike

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: per VBA ermitteln, wieviele IE-Explorer offen
22.11.2004 17:40:39
Nepumuk
Hallo Mike,
so:


Option Explicit
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32.dll" (ByVal dwFlags As LongByVal th32ProcessID As LongAs Long
Private Declare Function Process32First Lib "kernel32.dll" (ByVal hSnapshot As LongByRef lppe As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "kernel32.dll" (ByVal hSnapshot As LongByRef lppe As PROCESSENTRY32) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As LongAs Long
Private Enum Costant
    TH32CS_SNAPPROCESS = &H2
    MAX_PATH = 260
End Enum
Private Type PROCESSENTRY32
    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 * MAX_PATH
End Type
Public Sub Alle_Prozesse()
    Dim Snap As Long, Process As PROCESSENTRY32, Result As Long, intCount As Integer
    Snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
    If Snap <> -1 Then
        Process.dwSize = Len(Process)
        Result = Process32First(Snap, Process)
        Do Until Result = 0
            If Left$(Process.szExeFile, 12) = "IEXPLORE.EXE" Then intCount = intCount + 1
            Result = Process32Next(Snap, Process)
        Loop
    End If
    CloseHandle Snap
    MsgBox CStr(intCount)
End Sub


Gruß
Nepumuk
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige