Click to See Complete Forum and Search --> : Can I know whether a specified application is active in memory??


Samantha
March 29th, 1999, 09:29 AM
Hello All!!


I want to know whether a particular application is active in memory or not thru my VC++ application. For example I want to know whether MS-Word is active in memory or not. Can I know this?? If so how?? Please guide me thru this and specify the required API functions etc for this.


Thanks and Love in advance.

Samantha Katherine.

Raphael Phan
March 29th, 1999, 10:26 AM
Hi Samantha,


Well, you can take a look at the codeguru example under the MISC section: Threads/Processes

Enumerating Running Processes in Win95 and WinNT - Tomer Patel (1998/08/06)

http://www.codeguru.com/misc/index.shtml


where there is an example of how we can get our application to show all the current processes(which are just programs in execution in memory), plus also the function to determine whether a process is active or not. I have read through the code and implemented it in my program and I think it is very well-written in that it is easy for us to understand.


In this case we are making use of the tool help functions found in kernel32.dll,

namely Process32First and Process32Next. We use them to get the process ids of all processes in memory. Since you want to know whether a process is active or not, pay special attention to the GetProcessStatus function


Good luck


Raphael