How can I simulate these calls inside a program? Like say I want to find all the active connections. So I want to use netstat -a How could I use that without having to literally having a window open?
+6
A:
Use CreateProcess, redirecting the output.
If the calling application is not a windows application there is no issue with a console window (because a console programming will, by default, inheirt its parent console).
If the calling application is a windows application, set the right options passed to CreateProcess to default the console window that will be created to hidden.
Richard
2009-04-04 16:57:17
+2
A:
There is system()
library function you can use - I guess Windows has it as well because it is standard C function since C89.
qrdl
2009-04-04 17:00:15
A:
You will have to use the "/B" option of 'start' command.
cmd /C start "Title" /B netstat -i
I'm assuming popping console is your main problem, and you a strategy of collecting the data.
Vardhan Varma
2009-04-04 17:25:11