"
looks more like a URL than a program. Since *.com
is a valid file extension for a DOS executable, I would imagine the
system would search the PATH for a program file name "
(which probably doesn't exist) and therefore ShellExecute would fail.
If you are trying to open a URL the default browser, you might try
something like "
The "
should invoke
the default protocal handler for http, which is normally your web browser.
A far as putting the program in a "specified" window, the window handle
is assigned automatically by the system, and you can't change it. The
return value of ShellExecute() should give you window handle. If you
want your program to "swallow" the window, you can try using the
Windows API SetParent() function. ShellExecute is a bit flaky about
the way it returns a value, the CreateProcess() function might give
more predictable results.