hi
I wrote a small code to find a specific process (in this case the notepad.exe).It compiles Ok but it wont identify the notepad. any one know why???
I'm using VC++ 6.0
here is the code
Code:#include <windows.h> #include <stdio.h> #include <Tlhelp32.h> void getprocess(); PROCESSENTRY32 pr; HANDLE hpro; BOOL test=TRUE; int main(void){ getprocess(); return 0; } void getprocess(){ hpro=CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); pr.dwSize=sizeof(PROCESSENTRY32); Process32First(hpro,&pr); while(test==TRUE){ test=Process32Next(hpro,&pr); if(pr.szExeFile == "notepad.exe"){ MessageBox(NULL,"Notepad is running","Messenger",MB_OK); } printf(pr.szExeFile); printf("\n"); } CloseHandle(hpro); }



LinkBack URL
About LinkBacks



