From: SMTP%"Steve_Weinrich@keyvision.com" 23-NOV-1997 16:07:19.91 To: "'Phil Daley'" , "Chen, Mike (Anaheim)" CC: "'ntdev@atria.com'" Subj: RE: [ntdev] Send a signal to a process Return-Path: owner-ntdev@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Sun, 23 Nov 1997 16:05:51 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id RAA20003 for ; Sat, 22 Nov 1997 17:38:51 -0500 (EST) Received: by gw.atria.com id Sat, 22 Nov 1997 13:51:27 -0500 Received: from cip-server.cipartners.com by gw.atria.com id Sat, 22 Nov 1997 13:51:22 -0500 Received: by cip.cipartners.com with Internet Mail Service (5.0.1458.49) id ; Sat, 22 Nov 1997 13:50:09 -0500 Message-ID: From: Steve Weinrich To: "'Phil Daley'" , "Chen, Mike (Anaheim)" Cc: "'ntdev@atria.com'" Subject: RE: [ntdev] Send a signal to a process Date: Sat, 22 Nov 1997 13:50:07 -0500 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain Sender: owner-ntdev@atria.com Precedence: bulk I think what you might be looking for is the Event capabilities in NT. If you want one process to send a "signal" to another, you can have each of them Open a handle to a named event (you name it whatever you want) and then have the receiving process enter a "WaitForSingleObject( )" and have the other, when it is ready, "Set" the event. For example: RECEIVER CODE FRAGMENT: ... // Create the event (all events are system global - seen by all processes and threads) HANDLE hEvent; // must stay in scope while waiting hEvent = CreateEvent( NULL, // Default security FALSE, // Auto-Reset (ie: back to non-signaled state) after the //signal has been received by all waiting processes FALSE, // Initially not signaled "SomeNameThatYouMakeUp"); if (hEvent != NULL) // CreateEvent( ) worked { // This causes this thread to pause and wait for // the sending process (thread) to perform the SetEvent(); WaitForSingleObject( hEvent, INFINITE ); } ... // Perform the work you wanted to do at Signal time ... SENDER CODE FRAGMENT ... // Attempt to open the event (since they are global, the one created in // the receiver will be visible to the sender HANDLE hEvent; hEvent = OpenEvent( EVENT_MODIFY_STATE, // we just want to SetEvent( ) on it FALSE, // no need to set it to inheritable "SomeNameThatYouMakeUp"); // Set the state of the event to SIGNALED // This will cause the RECEIVER to immediately exit the "WaitForSingleObject( )" function SetEvent(hEvent); CloseHandle(hEvent); Hope this helps! -Steve Weinrich weinrich@keyvision.com > -----Original Message----- > From: Phil Daley [SMTP:p_daley@conknet.com] > Sent: Saturday, November 22, 1997 8:52 AM > To: Chen, Mike (Anaheim) > Cc: 'ntdev@atria.com' > Subject: Re: [ntdev] Send a signal to a process > > At 04:44 PM 11/21/97 -0800, Chen, Mike (Anaheim) wrote: > > > >Is there a function to send a signal to a process in NT? I am using > >VC++5.0 on NT4.0. > > > >In unix, I can use kill() function to do it. In VC, I can only find > the > >signal() function, but not the kill() ? There is another function > >TerminateProcess() in Win32, but it just kill the process. I need to > >send a signal to a process. It is up to the process to handle it or > not. > > You can send a process a WM_QUIT message, and then it can do exit > processing before shutting down. > > > Phil Daley < formerly of Relay Technology > > http://www.conknet.com/~p_daley > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > [ To unsubscribe, send email to ntdev-request@atria.com with body > UNSUBSCRIBE (the subject is ignored). ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]