Re: Quesion on mutex
- From: "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 13 Jul 2006 09:20:36 -0700
<sabarad_arun@xxxxxxxxxxx> wrote in message
news:1152774572.474517.322040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi David,
i was able to do it..I used the toolhelp API's to do this..The code is
as follows.
HANDLE hSnapShot;
hSnapShot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS ,0);
PROCESSENTRY32* processInfo=new PROCESSENTRY32;
processInfo->dwSize=sizeof(PROCESSENTRY32);
while(Process32Next(hSnapShot,processInfo)!=FALSE)
{
cout<<endl<<"Name: "<<processInfo->szExeFile;
}
CloseHandle(hSnapShot);
delete processInfo;
From this i get the list of all the processes running in the system..
Glad you found a solution, Arun! BTW, I've found that on Win2K,
processInfo->szExeFile is truncated to some number of characters (11 or 16,
I think). It's not truncated on Win9x or WinXP. So if the process has a
longer filename than that, it will be truncated. To get the full filename,
I believe I iterated the modules of the process, and the first module
retrieved will be the .exe (with the full name).
Even Process Explorer (sysinternals.com) has this problem. On Win2K, it
shows a truncated process name. I've e-mailed Mark Russinovich, but so far
he hasn't fixed it.
-- David
.
- References:
- Quesion on mutex
- From: sabarad_arun
- Re: Quesion on mutex
- From: David Ching
- Re: Quesion on mutex
- From: sabarad_arun
- Re: Quesion on mutex
- From: David Ching
- Re: Quesion on mutex
- From: sabarad_arun
- Quesion on mutex
- Prev by Date: Re: WM_COPY,WM_PASTER override in CEdit
- Next by Date: Constantly Updating Dialog Box Output
- Previous by thread: Re: Quesion on mutex
- Next by thread: Re: Quesion on mutex
- Index(es):