I got two console applications that the first one runs the second one:
1_first console application:
#include <Tchar.h>
#include <windows.h>
#include <iostream>
using namespace std;
void main(){
PROCESS_INFORMATION obj1;
memset(&obj1,0,sizeof(PROCESS_INFORMATION));
STARTUPINFOW obj2;
memset(&obj2,0,sizeof(STARTUPINFOW));
obj2.cb=sizeof(STARTUPINFOW);
CreateProcessW(_TEXT("c:\\runme.exe"),_TEXT("hello what's up?"),NULL,NULL,FALSE,NULL,NULL,NULL,&obj2,&obj1);
}
2_second console application named runme.exe:
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc,char * * argv){
if (argc>0)
for (int i=0;i<argc;i++)
cout <<"**->**"<<argv[i]<<"\n";
}
Now my problem is that both applications will use the same command prompt window, what should I do to get them using separate ones ?