getting name of exe file from task list 
Author Message
 getting name of exe file from task list

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



Tue, 01 Feb 2005 17:43:17 GMT  
 getting name of exe file from task list
How about using WMI?

Ali


Quote:
> 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



Thu, 03 Feb 2005 07:16:07 GMT  
 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



Fri, 04 Feb 2005 09:52:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. help switching file names or getting list of files in a dir

2. Adding tasks to a named task list

3. Getting the EXE name associated with a file

4. Getting short file name from long file name:

5. Getting active tasks list in VB

6. Getting Task List

7. Getting A Windows 95 Task List

8. Getting a Task List

9. Getting a list of Running Tasks in Windows 98

10. Getting list of ICONS of current tasks

11. List Field Names in Task Table

12. Change Task List Name

 

 
Powered by phpBB® Forum Software