This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Creating a separate console window via CreateProcess

I am building a application using the latest tools available via the cygwin 
setup program.  The application is supposed to open a separate DOS console 
window, but all processing seems to occur within the context of the DOS console 
window where I execute the program. 
I have cut the program down to the code that just does the process creation.  I 
would want the following program to open a separate DOS window to ask me for a 
password for the rexec command. 
I built the test program with: gcc -mno-cygwin  creprc.c -o creprc 
Could someone help me understand what I am doing wrong? 
#include <windows.h> 
#include <shellapi.h> 
#include <string.h> 
  char buffer[128]; 
  strcpy (buffer, "rexec testhost -l testuser testcommand"); 
  memset (&start, 0, sizeof (start)); 
  start.cb = sizeof (start); 
  start.dwFlags = STARTF_USESHOWWINDOW; 
  start.wShowWindow = SW_NORMAL; 
  memset (&child, 0, sizeof (child)); 
  if (CreateProcess (NULL, buffer, NULL, NULL, FALSE, 0, 
		NULL, NULL, &start, &child)) 
	CloseHandle (child.hThread); 
	CloseHandle (child.hProcess); 

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]