<p>This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before ShellExecute spawns the new process and returns. Does anyone know how to solve or work around this?</p>

<p>EDIT: And as the tags might indicate, this is on Win32 using C++.</p>

I don't know what is causing it, but Mark Russinovich (of sysinternal's fame) has a really great blog where he explains how to debug these kinds of things. A good one to look at for you would be
The Case of the Delayed Windows Vista File Open Dialogs
, where he debugged a similar issue using only process explorer (it turned out to be a problem accessing the domain). You can of course do similar things using a regular windows debugger.
You problem is probably not the same as his, but using these techniques may help you get closer to the source of the problem. I suggest invoking the
```
CreateProcess
```
call and then capturing a few stack traces and seeing where it appears to be hung.
The Case of the Process Startup Delays
might be even more relevant for you.