Originally posted by: Raghubansh Kumar
Can you comment on getting command line of a process
which was passed when it was created.
For NT and W2K.
Thanks In Advance,
Raghubansh
Originally posted by: ilgini
hi,how can i capture started new process and get your title.
Originally posted by: Amit Shirsikar
This code does not work in NT. It will compile successfully but will give an linker error that fuction 'Process32First' not found in Kernell32.dll.
Please somebody tell me how to run it in NT.
Amit Shirsikar
Pune.
Originally posted by: HA
Wow...cool :)
But, I wonder about the way to kill the process.
Please...give me a light to do that...
Thanks,
HA
Reply
Originally posted by: Eric
Process32First(hSnapShot, &pEntry);
} while (Process32Next(hSnapShot, &pEntry));
Of course this code assumes (as does the author's code) that there is at least one process in the system. If there isn't, you have bigger problems. :)
Also note the CloseHandle. I didn't see anywhere in the code where the snapshot was being cleaned up.
-Eric
The code as given will not display the first process in the system. Though the first process is probably the kernel and won't be missed, the correct way to walk the process list is as follows:
do {
... code to display process ...
CloseHandle(hSnapShot);
Originally posted by: Gabriel Duford
To make it work on Win9x, just change "%d" by "%u" in both sprintf call for th32ProcessID and th32ParentProcessID.
Reply
Originally posted by: von Arx Matthias
works only with Windows 2000 ...
Reply