delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/20/02:17:26

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: borota AT softhome DOT net
To: cygwin AT cygwin DOT com
Subject: main thread of a process
Date: Fri, 20 Feb 2004 00:17:04 -0700
Mime-Version: 1.0
X-Sender: borota AT softhome DOT net
X-Originating-IP: [65.42.95.1]
Message-ID: <courier.4035B470.00007CDF@softhome.net>

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019