Welcome everyone and thank you for your time.
I am developing some kind of monitoring application in C, and I needed to get a list of current tasks. So I use tasklist and get the result thanks popen ();
ptr = popen("tasklist /V", "r"); while(1) { if(fgets(temp, 255, ptr) == NULL) break; fputs(temp, log); }
The problem is that for some fractions of a second, the cmd.exe pop-up window appears and it really bothers because it switches focus to this new window, and this forces my application to switch to window mode instead of full-screen.
So, I spent days looking at both the pop-up path and Windows itself to start this process in a "hidden" mode / window, but did not get any result. Things I've already tried include:
cmd.exe /c tasklist /V start /b cmd.exe /c tasklist /V start /min /b cmd.exe /c tasklist /V start /min cmd.exe /c tasklist /V tasklist > somefile
I also tried the latter to read the result from some file, but it looks like the tasklist command prints to stdout, since no data is written, although the file is created.
I hope for your answer and thank you anyway.
source share