This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add option to cygstart to use CreateProcess as opposed to ShellExecuteEx


Chris Sutcliffe wrote:
> I'm not sure if this is the appropriate list for this question, but I
> was wondering if you would entertain an option to use CreateProcess
> within cygstart (as opposed the default ShellExecuteEx), or a separate
> executable that uses CreateProcess?  If this is inappropriate for this
> list, please let me know which list would be appropriate.

This is the right list, as far as I'm concerned.  However, the reason
ShellExecuteEx is used, is because you can do this:

$ cygstart foo.pdf

and Acrobat Reader (or whatever app is associated with .pdf) will be
launched.  You can't do that with CreateProcess.

> I've created a fairly basic utility (cygexec, source attached) that
> uses CreateProcess to launch windows executables.

So...how does this differ from run.exe and run2.exe?  They both use
CreateProcess...

> Doing some
> preliminary tests, it executes windows executables in about half a
> second (according to 'time') as opposed to 3.5 seconds with cygstart
> (as a result of the ShellExecuteEx call).

Well, that seems really strange.  Do you get the same slow behavior on
multiple machines/OS's, or just on a single machine?

--
Chuck


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]