Short answer: You can't.

Long answer: It depends on the platform and window manager used.

General answer: Use QProcess.