/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
hvordan tjekker man i task manager ?
Fra : Lasse Madsen


Dato : 27-06-03 08:41

Hej

Jeg har et program hvor det er nødvendigt at Microsoft ActiveSync ikke kører
filen hedder wcescomm.exe og man kan finde den i task manageren er det mig
muligt at tjekke om programmet kører fra visual basic ?

m.v.h.
lasse madsen



 
 
Robert (27-06-2003)
Kommentar
Fra : Robert


Dato : 27-06-03 13:06

Eksempel fra http://www.allapi.net/

Tjekker kørerende processer ved hjælp af PROCESS32 (API).

Paste flg ind i et nyt projekt


Const TH32CS_SNAPHEAPLIST = &H1
Const TH32CS_SNAPPROCESS = &H2
Const TH32CS_SNAPTHREAD = &H4
Const TH32CS_SNAPMODULE = &H8
Const TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST Or TH32CS_SNAPPROCESS Or
TH32CS_SNAPTHREAD Or TH32CS_SNAPMODULE)
Const TH32CS_INHERIT = &H80000000
Const MAX_PATH As Integer = 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
Private Declare 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)
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim hSnapShot As Long, uProcess As PROCESSENTRY32
'Takes a snapshot of the processes and the heaps, modules, and threads
used by the processes
hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0&)
'set the length of our ProcessEntry-type
uProcess.dwSize = Len(uProcess)
'Retrieve information about the first process encountered in our system
snapshot
r = Process32First(hSnapShot, uProcess)
'set graphics mode to persistent
Me.AutoRedraw = True
Do While r
Me.Print Left$(uProcess.szExeFile, IIf(InStr(1, uProcess.szExeFile,
Chr$(0)) > 0, InStr(1, uProcess.szExeFile, Chr$(0)) - 1, 0))
'Retrieve information about the next process recorded in our system
snapshot
r = Process32Next(hSnapShot, uProcess)
Loop
'close our snapshot handle
CloseHandle hSnapShot
End Sub



Lars Lindgaard Jørge~ (03-08-2003)
Kommentar
Fra : Lars Lindgaard Jørge~


Dato : 03-08-03 21:30

Lasse Madsen <lm@h-tech.dk> skrev:
>Hej
>
>Jeg har et program hvor det er
>nødvendigt at Microsoft ActiveSync ikke kører
>filen hedder wcescomm.exe og man kan
>finde den i task manageren er det mig
>muligt at tjekke om programmet kører
>fra visual basic ?
>
>m.v.h.
>lasse madsen


Prøv at søg på www.mvps.org. Du skal bruge Randy Brich's VBnet
site, den indeholder præcis hvad du søger. Der er masser af mindre
kodeeksempler på den web-site...
--
Lars Lindgaard


Søg
Reklame
Statistik
Spørgsmål : 177496
Tips : 31968
Nyheder : 719565
Indlæg : 6408491
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste