
getting name of exe file from task list
It is different to get the exe file name between NT and Win9x.
In NT/Win2K, you need to use
OpenProcess, EnumProcessModules, and GetModuleFileNameEx.
In Win9x, you can use ToolHelp. You need to use CreateToolhelp32Snapshot,
Process32First, th32ProcessID,
Process32Next to iterate through the list of processes to find the one you
want and then get the name of the executable file.
This article is helpful:
HOWTO: List Running Processes
http://support.microsoft.com/support/kb/articles/q187/9/13.asp
Best Regards,
Alick Ye
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Subject: getting name of exe file from task list
Date: Fri, 16 Aug 2002 11:43:17 +0200
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Newsgroups: microsoft.public.vb.com
NNTP-Posting-Host: 212.224.16.158
Path: cpmsftngxa06!tkmsftngxs01!tkmsftngp01!tkmsftngp08
Xref: cpmsftngxa06 microsoft.public.vb.com:30873
X-Tomcat-NG: microsoft.public.vb.com
Hi all,
does anybody know how do get the name of a running exe file from the task
list?
Using following code
Dim CurrWnd as long
CurrWnd = GetWindow(frm.hWnd, GW_HWNDFIRST)
while CurrWnd <> 0
..
Length = GetWindowTextLength(CurrWnd)
GetWindowText
..
GetWindow(CurrWnd,GW_HWNDNEXT)
wend
i get the task names of running processes but not the name of the exe file.
Is there a chance to get it and how?
Thanks in advance..
Hugo