how to get list of pid of all processes running on the system using c++ in windows???
get list of pid of all processes running on the system
Collapse
X
-
Tags: None
-
-
Originally posted by weaknessforcatsTry EnumProcess() in psapi.h.
process error LNK2019: unresolved external symbol _EnumProcesses@ 12 referenced in function _mainComment
-
Originally posted by happiness4allits giving error
process error LNK2019: unresolved external symbol _EnumProcesses@ 12 referenced in function _main
include <windows.h>
#include<psapi. h>
#include <iostream>
using namespace std;
int main() {
u_long a[100];
u_long rsize;
EnumProcesses(a ,sizeof(a),&rsi ze);
return 0;
}
[/code]Comment
-
Originally posted by happiness4allQuote:
Originally Posted by happiness4all
its giving error
process error LNK2019: unresolved external symbol _EnumProcesses@ 12 referenced in function _main
Code: ( cpp )
include <windows.h>
#include<psapi. h>
#include <iostream>
using namespace std;
int main() {
u_long a[100];
u_long rsize;
EnumProcesses(a ,sizeof(a),&rsi ze);
return 0;
}
This code compiles and links with no errors on Visual Studio.NET 2005 after I added psapi.lib to the build.Comment
-
Originally posted by weaknessforcatsYou forgot to add psapi.lib to your build as an additional linker dependency.
This code compiles and links with no errors on Visual Studio.NET 2005 after I added psapi.lib to the build.
why do we have to add some libslike wsock32.lib when we use winsock..etc.Comment
-
Originally posted by happiness4allwhy do we have to add some libslike wsock32.lib when we use winsock..etc.
For example, you can create your own library with youe favorite functions in it and to the same.Comment
Comment