Thaats it. I have tried much so I give up.
Learning native c++ didnīt pay up. Coding windows is like starting from clean table.
my code this far is like this:
Code:
#include<windows.h>
#include<stdio.h>
#include<tchar.h>
void _tmain( int argc, TCHAR *argv [] )
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
STARTUPINFO sj;
PROCESS_INFORMATION pj;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
ZeroMemory( &sj, sizeof(sj) );
sj.cb = sizeof(sj);
ZeroMemory( &pj, sizeof(pj) );
// Start the child process.
if( !CreateProcess( NULL,
"A.exe", // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi ) // Pointer to PROCESS_INFORMATION structure
)
if (pi.hProcess != 0)
ResumeThread (pj.hThread);
WaitForSingleObject( pi.hProcess, INFINITE );
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
if( !CreateProcess( NULL,
"B.exe",
NULL,
NULL,
FALSE,
CREATE_SUSPENDED,
NULL,
NULL,
&sj,
&pj )
)
...............................the rest is obvious....}
now both applications (A and B) opens a window but simultaneusly, so I suspended one thread.
and now I have to resume suspended thread. I have tried everything:
ResumeThread (sj. / pj.hthread / .process and tried putting &sj/&pj...
Should I add more parameters in STARTUPINFO or PROCESS_INFORMATION?
no luck, so what is that handle which is importatnt for resumethread?
thanx and sorry being noob.