On Mon, 4 Aug 2003, David Fraser wrote:

> >I can send you code which spawns new processes from a running windows app.
> Could you send it to the list?

        
    /* we must build this string with information about mount points */
    const char* command = "c:\\cygwin\\usr\\x11r6\\xterm.exe -display :0.0";

    STARTUPINFO startupinfo;
    PROCESS_INFORMATION processinformation;
    memset(&startupinfo, 0, sizeof startupinfo);
    startupinfo.cb = sizeof startupinfo;

    if (!CreateProcess(
        "xterm", command,                                       // name and 
commandline 
        NULL, NULL, false,                                      // Not important 
        /* CREATE_NEW_CONSOLE | */ CREATE_NEW_PROCESS_GROUP,    // Process flags. 
Maybe 0 is sufficient for our needs
        NULL,                                                   // Environment. Null 
inherits from parent process
        NULL,                                                   // Working dir. Null 
uses current dir. 
        startupinfo, &processinformation                        // Process information.
        ))
    {
        // error
    }

or for cygwin 

int pid = fork();
if (pid == 0) {
        execl("/usr/X11R6/bin/xterm.exe", "-display", ":0.0", NULL);
} else if (pid == -1) {
        // error
}
-- 
 [EMAIL PROTECTED] 
 http://www.gotti.org           ICQ: 126018723

Reply via email to