Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List running apps + get path and exe

Status
Not open for further replies.

Horrid

Programmer
May 20, 1999
373
I have been trying for the past few days to get a list of the running applications, the window title (window class would be nice) and the applications path and exe file. I have had some success with enumwindows, getting the windows processId (via GetWindowThreadProcessId) then finding the matching process with CreateToolhelp32Snapshot. The problems I have is that EmunWindows doesn't let me know what windows are applications so I end up with a huge amount of garbage (eg Default IME about 20 times) and I only get the exe name from the PROCESSENTRY32 structure.
How do I find out which windows are application windows and then get the exe from them. Or am I going in the wrong direction.


Thanks
 
Solution:

Step through all top level windows with enumwindows, find those that qualify to be displayed on the taskbar. Use CreateToolhelp32Snapshot to step through all processes and find the one matching the top level window. Then use psapi EnumProcessModules and GetModuleFileNameEx to extract the full path name.

If someone would like to see the code I would be happy to post it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top