process IDīs

This is a discussion on process IDīs within the C++ Programming forums, part of the General Programming Boards category; how are u doing? i havent posted for about 4 months i think..
anyway im looking for a way to ...

process IDīs

how are u doing? i havent posted for about 4 months i think..

anyway im looking for a way to get a windows processes ID &/or HANDLE.
i have googled for about 2 hours all i find is some bad codes with lots of errors etc. ive also looked thru MSDN.
anyone got the experience.

Could you tell us exactly what you are trying to achieve? For which process do you need a process ID? What are you going to use it for? With a little more information we can probably provide more detailed help.

Now adapt this code to your needs.
NOTE the 32 in the types names. That referes to 32-bit processes. Later with 64-bit CPU we'll use 64, for 64 bit processes, and 32 for 32 bit processes running on 64 bit machine, although emulated.

That link shows code for listing all the processes (That code gives process name, like explorer.exe and also gives process ID of each one). My suggestion is make a simple class to hold process name, PID, and handle. Then make a list of that class, and instead of printing them to the screen, insert them into a list, then you have a list you can search through processes and such. I have just recently done this, if you want any help, IM or email me.