> printf ("Processo: %s\n", szProcessName);
Well you do print whatever happened to be in the buffer last, whether or not some previous functions returned 'success' or 'failure'.
> printf ("Processo: %s\n", szProcessName);
Well you do print whatever happened to be in the buffer last, whether or not some previous functions returned 'success' or 'failure'.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
You need to have your printf() after all the functions, as some processes you aren't allowed to open without debugging privileges. At the moment you're just printing something without knowing if those functions succeeded or not.
thanx everyone I've put the printf into the :the strange thing is that I have to filter the first result, infact if I don't initializeCode:if ( NULL != hProcess )
the first (bugged!) result is the last executed program.. if I initialize it to something, this something will be the first process found.. anyway I've filtered it out and it's working well, anyway I will debug better the code to see what it's really happening, because I'm afraid this will lead to some other nested bugsCode:char szProcessName[MAX_PATH]
thanks to everyone
This forum is the best one I've ever seen. Great ppl, great coders