Hi. How can i find how much windows are running at the same time? For example i need to find how much Calcultators are running. I tried using FindWindow()
but it always returns me same handle. Any ideas?
Thank you
lukename
0
Light Poster
Recommended Answers
Jump to PostHi here is a function that will do this for you
CString YOURCLASS::GetEXEName(DWORD dwProcessID) { DWORD aProcesses [1024], cbNeeded, cProcesses; unsigned int i; //Enumerate all processes if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) return NULL; // Calculate how many process identifiers were returned. cProcesses = cbNeeded / sizeof(DWORD); TCHAR szEXEName[MAX_PATH]; …
Jump to PostHi sorry yes you need to add this #include "psapi.h"
#pragma comment(lib, "psapi.lib")Should work fine after that also you shouldn't need to chage the return NULL either or add psapi.lib to you linker options what version of visual studio are you using
Jump to Postok it will work fine with 2005 i have it working under 2010 make sure you have windows sdk installed also then it will definity compile for you
All 9 Replies
nchannon
0
Newbie Poster
lukename
0
Light Poster
lukename
0
Light Poster
nchannon
0
Newbie Poster
nchannon
0
Newbie Poster
lukename
0
Light Poster
nchannon
0
Newbie Poster
lukename
0
Light Poster
nchannon
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.