Question : Handle to CreateProcess

How can i get a Handle to a thread that was created using CreateProcess.

i don't  want to use AfxBeginThread instead of CreateThread

Answer : Handle to CreateProcess

STARTUPINFO st;
PROCESS_INFORMATION AppProcess;
char * ExeName       ====>> your exe's file name (path + filename)

// fill the startup-info like you want to : ex ->
st.cb            = sizeof(STARTUPINFO);
st.lpReserved      = NULL;
st.lpDesktop      = NULL;
st.lpTitle            = NULL;
st.dwX            = 0;
st.dwY            = 0;
st.dwXSize      = 300;
st.dwYSize      = 300;
st.dwFlags            = 0;
st.cbReserved2      = NULL;
st.lpReserved2      = NULL;

res = CreateProcess(NULL,ExeName,NULL,NULL,FALSE,CREATE_NO_WINDOW | CREATE_SUSPENDED ,NULL,NULL,&st,&AppProcess);

ResumeThread(AppProcess.hThread);
Random Solutions  
 
programming4us programming4us