vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Schützen Sie Ihre Software vor Software-Piraterie - mit sevLock 1.0 DLL!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Visual-Basic Einsteiger
Re: Process ID ermitteln / Überprüfen ob Prozess läuft 
Autor: BasTler
Datum: 14.03.06 11:20

Hey Frank,

hier sind noch die notwendigen Declares.
Public strProcID As String
 
' zunächst die benötigten API-Deklarationen
Private Declare Function CreateToolhelpSnapshot Lib _
  "kernel32" Alias "CreateToolhelp32Snapshot" ( _
  ByVal lFlgas As Long, ByVal lProcessID As Long) _
  As Long
 
Private Declare Function ProcessFirst Lib "kernel32" _
  Alias "Process32First" (ByVal hSnapshot As Long, _
  uProcess As PROCESSENTRY32) As Long
 
Private Declare Function ProcessNext Lib "kernel32" _
  Alias "Process32Next" (ByVal hSnapshot As Long, _
  uProcess As PROCESSENTRY32) As Long
 
Private Declare Sub CloseHandle Lib "kernel32" ( _
  ByVal hPass As Long)
 
Private Const TH32CS_SNAPPROCESS As Long = 2&
Private Const MAX_PATH As Long = 260
 
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 Enum procReturnValue
  Handle = 0
  ProcessID = 1
End Enum
 
' Für WinNT4
Private Declare Function EnumProcesses Lib "psapi.dll" ( _
  ByRef lpidProcess As Long, _
  ByVal cb As Long, _
  ByRef cbNeeded As Long) As Long
 
Private Declare Function OpenProcess Lib "kernel32" ( _
  ByVal dwDesiredAccess As Long, _
  ByVal bInheritHandle As Long, _
  ByVal dwProcessId As Long) As Long
 
Private Declare Function EnumProcessModules Lib "psapi.dll" ( _
  ByVal hProcess As Long, _
  ByRef lphModule As Long, _
  ByVal cb As Long, _
  ByRef lpcbNeeded As Long) As Long
 
Private Declare Function GetModuleFileNameEx Lib "psapi.dll" _
  Alias "GetModuleFileNameExA" ( _
  ByVal hProcess As Long, _
  ByVal hModule As Long, _
  ByVal lpFilename As String, _
  ByVal nSize As Long) As Long
 
Private Const PROCESS_QUERY_INFORMATION = 1024
Private Const PROCESS_VM_READ = 16
 
' APIs, um die Windows-Version abzufragen
Private Type OSVERSIONINFO
  dwOSVersionInfoSize As Long
  dwMajorVersion As Long
  dwMinorVersion As Long
  dwBuildNumber As Long
  dwPlatformID As Long
  szCSDVersion As String * 128
End Type
 
Private Declare Function GetVersionEx Lib "kernel32" _
  Alias "GetVersionExA" _
  (ByRef lpVersionInformation As OSVERSIONINFO) As Long
 
Private Const VER_PLATFORM_WIN32_NT = 2
Private Const VER_PLATFORM_WIN32_WINDOWS = 1
 
 
' weitere API-Deklarationen
Private Declare Function GetWindowThreadProcessId Lib _
  "user32" (ByVal hwnd As Long, lpdwProcessId As Long) _
  As Long
 
Private Declare Function FindWindow Lib "user32" _
  Alias "FindWindowA" (ByVal lpClassName As String, _
  ByVal lpWindowName As String) As Long
 
Private Declare Function GetWindow Lib "user32" _
  (ByVal hwnd As Long, ByVal wCmd As Long) As Long
 
Private Declare Function GetParent Lib "user32" _
  (ByVal hwnd As Long) As Long
 
Private Const GW_HWNDNEXT = 2
Habe aber jetzt nicht geprüft, ob auch wirklich alle benötigt werden.

Viel Erfolg
BAStler
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Process ID ermitteln / Überprüfen ob Prozess läuft1.490Frank32114.03.06 10:39
Re: Process ID ermitteln / Überprüfen ob Prozess läuft810BasTler14.03.06 11:16
Re: Process ID ermitteln / Überprüfen ob Prozess läuft576BasTler14.03.06 11:20
Re: Process ID ermitteln / Überprüfen ob Prozess läuft575Frank32114.03.06 12:30

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel