Even I was having the same problem with the visual c and when I try to compile the source code I came up with a compile error. The source code through an error message is given below:-
Code:
#include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
BOOL Getcourserecord ()
{
HANDLE hcourse= NULL;
BOOL ar = FALSE;
PROCESSENTRY32 p32 = {0};
hcourse = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hcourse == INVALID_HANDLE_VALUE)
return (forged);
p32.dwSize = sizeof(PROCESSENTRY32);
if (Process32First(hcourse, & p32))
{
DWORD dwPriorityClass;
BOOL getm = FALSE;
MODULEENTRY32 me32 = {0};
do
{
getm = GetProcessModule(p32.th32ProcessID,
p32.th32ModuleID, &me32, sizeof(MODULEENTRY32));
if (getm)
{
HANDLE hProcess;
hProcess = OpenProcess (PROCESS_ALL_ACCESS,
FALSE, p32.th32ProcessID);
dwPriorityClass = GetPriorityClass (hProcess);
CloseHandle (hProcess);
printf( "\n precedence group \t%d\n",
p32.pcPriClassBase);
printf( "PID123\t\t\t%d\n", p32.th32ProcessID);
printf( "Thread calculate\t\t%d\n", p32.cntThreads);
printf( "Module given name\t\t%s\n", me32.szModule);
printf( "Full pathway\t\t%s\n\n", me32.szExePath);
}
}
while (Process32Next(hProcessSnap, & p32));
ar = right;
}
else
ar = forged; CloseHandle (hcourse);
return (ar);
}
int main (int argc, char** argv)
{
Getcourserecord ();
return 0;
}
is showing an error c2065 and says undeclared identifier
Bookmarks