Re: ShellExecute...

Tech-Archive recommends: Fix windows errors by optimizing your registry



Why shoult that surprise you? The return type is HINSTANCE. RTFM.
joe

On 26 May 2007 05:09:42 -0700, hamishd <Hamish.Dean@xxxxxxxxx> wrote:

On May 26, 6:17 pm, MrAsm <m...@xxxxxxx> wrote:
On 26 May 2007 02:31:51 -0700, hamishd <Hamish.D...@xxxxxxxxx> wrote:

I want to run the install program Install.cmd

ShellExecute(NULL, "open", "c:\\Install.cmd", NULL, "c:\\",
SW_SHOWNORMAL);

You'd better using _T() for strings:

ShellExecute(
NULL,
_T("open"),
_T("c:\\Install.cmd"),
NULL,
_T("c:\\"),
SW_SHOWNORMAL
);

Nothing happens... where am i going wrong?

What is the return code of the function? It might help understanding
the problem...

Stupid question, but when I go: int R = ShellEx..... compiler doesn't
like it. So I go: HINSTANCE H = ShellEx....

But what do I do with H to get the returned val?
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.