X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "skylazart" Newsgroups: comp.os.msdos.djgpp Subject: Re: fork () system () in windows 32 Date: 25 Sep 2006 13:08:22 -0700 Organization: http://groups.google.com Lines: 59 Message-ID: <1159214902.083501.227030@d34g2000cwd.googlegroups.com> References: <1158958792 DOT 016136 DOT 195840 AT e3g2000cwe DOT googlegroups DOT com> <200609222113 DOT k8MLD7Fd030125 AT envy DOT delorie DOT com> NNTP-Posting-Host: 200.220.224.33 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1159214907 20783 127.0.0.1 (25 Sep 2006 20:08:27 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Mon, 25 Sep 2006 20:08:27 +0000 (UTC) In-Reply-To: <200609222113.k8MLD7Fd030125@envy.delorie.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060904 Debian/1.7.8-1sarge7.2.2,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 ISA01 Complaints-To: groups-abuse AT google DOT com Injection-Info: d34g2000cwd.googlegroups.com; posting-host=200.220.224.33; posting-account=3HlXAA0AAADjCUweOPFDY0dx_Y4v75jD To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Sorry, Im using devCPP IDE. I have solved the problem with CreateProcess () void OpenNotepad (char * file) { char cmd[8192]; BOOL success = 0; STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb=sizeof(si); si.lpReserved=NULL; si.lpDesktop="Default"; si.lpTitle=NULL, si.dwFlags=STARTF_USESHOWWINDOW; si.wShowWindow = SW_SHOWMAXIMIZED; si.cbReserved2=0; si.lpReserved2=NULL; PROCESS_INFORMATION pi; ZeroMemory( &pi, sizeof(pi) ); if (file == NULL) { success = CreateProcess(NOTEPAD, NULL, NULL, NULL, FALSE, DETACHED_PROCESS, /* CREATE_NEW_CONSOLE is the same :( */ NULL, NULL, &si, &pi); } else { snprintf (cmd, sizeof (cmd), "%s %s", NOTEPAD, file); success = CreateProcess(NULL, cmd, //"C:\\WINDOWS\\NOTEPAD.EXE c:\\la.txt", //"c:\\la.txt", NULL, NULL, FALSE, DETACHED_PROCESS, /* CREATE_NEW_CONSOLE is the same :( */ NULL, NULL, &si, &pi); } } Tkz!!! DJ Delorie wrote: > Sorry, djgpp isn't a windows compiler (it's a dos compiler that > happens to run under windows), so you don't have access to > windows-specific things like process control. > > Try cygwin if you need a real posix fork().