🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Richard Yu Tue, 29 Apr 2003 22:07
how to start an application from inside my code?
#16691
Author: Richard Yu
Date: Tue, 29 Apr 2003 22:07
8 lines
1094 bytes
I want to start an exe application from inside my  code, how can i do that ?

example : like to start a "aApplication param1 param2",    aApplication is
an exe.

something like shellexecute() ?

thanks for the help.
Re: how to start an application from inside my code?
#16692
Author: Mehmet
Date: Tue, 29 Apr 2003 22:27
43 lines
1896 bytes
Hi,,,

You can use CreateProcess();
eg.

STARTUPINFO si;
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);

PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));

CreateProcess(NULL,
              "c:\\program files\\internet explorer\\iexplore.exe -new
http://www.av.com",
              NULL,
              NULL,
              FALSE,
              0,
              NULL,
              NULL,
              &si,
              &pi
              );

//close handles opened by CreateProcess
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);


"Richard Yu" <richard@colorselector.com> wrote in message
news:3eaef833@newsgroups.borland.com...
> I want to start an exe application from inside my  code, how can i do that
?
>
> example : like to start a "aApplication param1 param2",    aApplication is
> an exe.
>
> something like shellexecute() ?
>
> thanks for the help.
>
>
Re: how to start an application from inside my code?
#16693
Author: Remy Lebeau (TeamB)
Date: Tue, 29 Apr 2003 22:38
10 lines
1182 bytes
"Richard Yu" <richard@colorselector.com> wrote in message
news:3eaef833@newsgroups.borland.com...
> I want to start an exe application from inside my  code, how can i do that
?

Have a look at the WinExec() or CreateProcess() functions.


Gambit
Re: how to start an application from inside my code?
#16695
Author: StarCinema - Rodolfo Frino
Date: Wed, 30 Apr 2003 00:17
41 lines
2037 bytes
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    STARTUPINFO StartupInfo;
    PROCESS_INFORMATION ProcInfo;

    ZeroMemory(&StartupInfo, sizeof(StartupInfo));
    StartupInfo.cb = sizeof(StartupInfo);
    ZeroMemory(&ProcInfo, sizeof(ProcInfo));

    if( !CreateProcess( NULL,
        "c:\\program files\\outlook express\\wab.exe",
        NULL, NULL, FALSE, 0, NULL, NULL, &StartupInfo, &ProcInfo))
    {
        ShowMessage("CreateProcess failed.");
    }

    // Wait until the child process exits
    WaitForSingleObject(ProcInfo.hProcess, INFINITE);

    CloseHandle(ProcInfo.hProcess);
    CloseHandle(ProcInfo.hThread);
}

Rodolfo
Stargate Software
http://members.optusnet.com.au/~rodolfofrino/


"Richard Yu" <richard@colorselector.com> wrote in message
news:3eaef833@newsgroups.borland.com...
> I want to start an exe application from inside my  code, how can i do that
?
>
> example : like to start a "aApplication param1 param2",    aApplication is
> an exe.
>
> something like shellexecute() ?
>
> thanks for the help.
>
>
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