Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

how to safely use EnumProcesses older and new OS

$
0
0
MSDN says this about EnumProcess

If PSAPI_VERSION is 2 or greater, this function is defined as K32EnumProcesses in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as EnumProcesses in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32EnumProcesses.

Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as EnumProcesses. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.

anyone have code to safely use this method that will safely run on older and newer OS?

Thanks

Indika

Viewing all articles
Browse latest Browse all 3042

Trending Articles