D Paste by Create Process Codes
Description: Create Process Crappy Example
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | LPCTSTR lpApplicationName = .toStringz(/*"C:\\WINDOWS\\NOTEPAD.exe"*/ /*pathName*/ r"D:\Desktop\test6\test6.exe"); LPCTSTR lpCommandLine = .toStringz(" " ~ /*args*/ r"text=D:\Desktop\test6\chinese.txt font=D:\Desktop\test6\fonts\wt021.ttf size=24"); LPCTSTR lpCurrentDirectory = .toStringz(globals.programDir.dup); uint bufferSize = 0; SECURITY_ATTRIBUTES security; security.nLength = security.sizeof; security.lpSecurityDescriptor = null; security.bInheritHandle = true; //HANDLE read1,read2,read3,write1,write2,write3; //read1 = read2 = read3 = write1 = write2 = write2 = INVALID_HANDLE_VALUE; //CreatePipe(&read1,&write1,&security,bufferSize); //CreatePipe(&read2,&write2,&security,bufferSize); //CreatePipe(&read3,&write3,&security,bufferSize); // collect startup info STARTUPINFOA startup; GetStartupInfoA(&startup); //startup.hStdInput = read1; //startup.hStdOutput = write2; //startup.hStdError = write3; startup.dwFlags = STARTF_USESTDHANDLES; startup.cb = STARTUPINFOA.sizeof; PROCESS_INFORMATION* info = new PROCESS_INFORMATION(); //msgBox(.toString(lpApplicationName)); //msgBox(.toString(lpCommandLine)); msgBox("Launch " ~ .toString(lpApplicationName) ~ .toString(lpCommandLine)); if ( CreateProcessA( lpApplicationName, lpCommandLine, null, null, false, CREATE_DEFAULT_ERROR_MODE, null, null, &startup, info) != 0 ) { } |