PDA

View Full Version : get window handle of system()?



dsab123
06-28-2012, 04:00 PM
I'm sorry if this is a stupid question; I am attempting to get the window handle of a program that's executed using the system() command, i.e. something like:




int pid = fork();
if (fork == 0) {
system("program name")
} else {
...
}



Is this possible? would it be possible to do so if I used one of the exec() functions instead?

Thanks! (using Kubuntu 12 btw)



EDIT: ehh..I think it might be better to ask this on linuxforums, now that I think about it...

dsab123
07-13-2012, 11:18 AM
For anyone else who has/had this problem, you can't do it with system(), because in system(3): execute shell command - Linux man page (http://linux.die.net/man/3/system), the program is run in the shell, which (I think) makes it impossible to get the window handle, or ID

laserlight
07-13-2012, 11:29 AM
Moved to Linux Programming forum.