How do I get the window handle of a shelled program's main window from the taskid that the shell function returns?

E.G. If I use the following code:
Code:
lTaskID = Shell("pbrush.exe", vbNormalFocus)
I need to use lTaskID to get the handle of the window entitled "Untitled - Paint".

I can't simply use FindWindow because the FindWindow function would usually run before the shelled program has finished loading up. That is the method I'm currently using, along with the Sleep function, but it's far from reliable.

I can use the ShellExecute API directly is that is easier.