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]

main thread of a process


I want to send messages to the main thread of a Win process created with 'spawn'. Is there a way to do that in 'pure Cygwin'?

The Windows sequence would be:
CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
...
PostThreadMessage(pi.dwThreadId, WM_QUIT, 0, 0); //or whatever
...


'spawn' returns the 'pid' of the new process. Is that always equal to pi.dwProcessId? Is there a way to get from this 'pid' to sending messages to the main thread? Is there a place where pi.dwThreadId is saved?
(global structure, etc.)


Thanks,
Greg

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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