From: dc2000 on
Hi everyone:


It sounds like a simple question, but how to emulate the Run command from
the Windows Start menu in my own program?

I don't mean simple running a program, what I'm talking about is how to use
command line parameters and stuff?

Something like this:

rundll32 user32.dll MessageBox
ipconfig /renew
"C:\Documents and Settings\User\Desktop\my app.exe" /par1 time="10:35:30 pm"
file="my file.doc"

All of the above works in Run window, but is there an API for it?

Thanks!
From: David Lowndes on
>It sounds like a simple question, but how to emulate the Run command from
>the Windows Start menu in my own program?
>
>I don't mean simple running a program, what I'm talking about is how to use
>command line parameters and stuff?

I'm not sure what you're asking. ShellExecute(Ex) is essentially the
API that is used.

Dave
From: Vladimir Scherbina on
"David Lowndes" <DavidL(a)example.invalid> wrote in message
news:kt9cm2tv0rhgk94h0v82npscudf2l1lupu(a)4ax.com...

[...]

> ShellExecute(Ex) is essentially the
> API that is used.

Or CreateProcess specifiying the command line arguments.

--
Vladimir (Windows SDK MVP)


From: dc2000 on
Thank you.

"Vladimir Scherbina" wrote:

> "David Lowndes" <DavidL(a)example.invalid> wrote in message
> news:kt9cm2tv0rhgk94h0v82npscudf2l1lupu(a)4ax.com...
>
> [...]
>
> > ShellExecute(Ex) is essentially the
> > API that is used.
>
> Or CreateProcess specifiying the command line arguments.
>
> --
> Vladimir (Windows SDK MVP)
>
>
>
From: dc2000 on
Interesting. I've just tried the following code:

STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
si.cb = sizeof(si);
CreateProcess(NULL, "rundll32 user32.dll MessageBox", 0, 0, FALSE, 0, NULL,
NULL, &si, &pi);

The result is TRUE but nothing happens. If one types the same in the Run
window, it shows a dialog box. What is the difference here?

PS. I'm using that rundll32 line as an example, I don't need to emulate a
call to MessageBox


"Vladimir Scherbina" wrote:

> "David Lowndes" <DavidL(a)example.invalid> wrote in message
> news:kt9cm2tv0rhgk94h0v82npscudf2l1lupu(a)4ax.com...
>
> [...]
>
> > ShellExecute(Ex) is essentially the
> > API that is used.
>
> Or CreateProcess specifiying the command line arguments.
>
> --
> Vladimir (Windows SDK MVP)
>
>
>