Launching Another Program

What is the most surefire way for a Win32 program to launch an EXE file and obtain a handle to its primary window? I read once that you can do this by launching the EXE, taking note of its process ID, enumerating all the windows and checking whether the current window's process ID matches the one you're searching for. Is there an easier way?
Nope.

[edit] You'll have to use EnumWindows() and GetWindowThreadProcessId().
Last edited on
Topic archived. No new replies allowed.