🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by Enrico B. Mon, 12 May 2003 09:25
WinExec problem
#16512
Author: Enrico B.
Date: Mon, 12 May 2003 09:25
17 lines
1605 bytes
Hi!,

I need to launch, from my program, another application. I tried the
following instruction:

WinExec("C:/vvoce/vvoce.exe", SW_SHOWDEFAULT);

The problem: the external application launched this way does not function
correctly, because the working directory appears to be the directory of my
program, not the directory of the external application. If I run that
application by double clicking its link on my desktop, the application works
correctly. So: is there a way to programmatically emulate a double click on
the icon (link) that launches that application?

Thanks in advance.

Henry
R: WinExec problem
#16514
Author: Steve
Date: Mon, 12 May 2003 09:24
25 lines
1800 bytes
>
> I need to launch, from my program, another application. I
tried the
> following instruction:
>
> WinExec("C:/vvoce/vvoce.exe", SW_SHOWDEFAULT);
>
> The problem: the external application launched this way
does not function
> correctly, because the working directory appears to be the
directory of my
> program, not the directory of the external application. If
I run that
> application by double clicking its link on my desktop, the
application works
> correctly. So: is there a way to programmatically emulate
a double click on
> the icon (link) that launches that application?

You could use CreateProcess instead. There, you can specify
the working directory for the child process.

HTH,

Steve.
Re: R: WinExec problem
#16513
Author: Al
Date: Mon, 12 May 2003 09:47
13 lines
1290 bytes
"Steve" <steve_alettoANTI@SPAMhotmail.com> wrote:

>> WinExec("C:/vvoce/vvoce.exe", SW_SHOWDEFAULT);

>You could use CreateProcess instead. There, you can specify
>the working directory for the child process.

I would suggest ShellExecute (shellapi.h)

ShellExecute(0,"open","vvoce.exe",0,"C:\\vvoce",SWSHOWDEFAULT);

Al
R: WinExec problem
#16523
Author: Enrico B.
Date: Mon, 12 May 2003 13:55
36 lines
1966 bytes
I used ShellExecute.

Thank you for your time.

Henry


Steve <steve_alettoANTI@SPAMhotmail.com> wrote in message
3ebf685c@newsgroups.borland.com...
> >
> > I need to launch, from my program, another application. I
> tried the
> > following instruction:
> >
> > WinExec("C:/vvoce/vvoce.exe", SW_SHOWDEFAULT);
> >
> > The problem: the external application launched this way
> does not function
> > correctly, because the working directory appears to be the
> directory of my
> > program, not the directory of the external application. If
> I run that
> > application by double clicking its link on my desktop, the
> application works
> > correctly. So: is there a way to programmatically emulate
> a double click on
> > the icon (link) that launches that application?
>
> You could use CreateProcess instead. There, you can specify
> the working directory for the child process.
>
> HTH,
>
> Steve.
>
>
Re: R: WinExec problem
#16525
Author: Al
Date: Mon, 12 May 2003 14:25
8 lines
1098 bytes
>I used ShellExecute.
>
>Thank you for your time.
>
>Henry

No Problem :)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads