title: How to intercept out-of-proc desktop STA COM to STA COM communication or reference counting decrementing?
body: <p>My example:
  PowerPoint start Excel when insert embedded workbook.
  I continue to work with PowerPoint. Excel stays as hidden process.
  When I close PowerPoint it says to Excel to close itself (Excel closed later then PowerPoint).
  When I kill PowerPoint, Excel becomes zombie.
  My add-in is loaded into Excel process.</p>
  
  <p>What message(I read that COM STA objects communicate through windows messaging) I should intercept to be notified about such event? What hook should I use? Is there any mean to be notified about count of reference to COM object changes?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>My question seems was ambiguous. I am not trying to handle case when I kill PowerPoint. It just for evidence that PowerPoint send some message to Excel when closed normally. I am trying to intercept this message for a good reason.</p>
  
  <p><strong>UPDATE2</strong></p>
  
  <p>I cannot use API - because API fails. I am trying to solve <a href="http://social.msdn.microsoft.com/Forums/nl/officegeneral/thread/79ac9e40-e8d0-4b71-9fb8-eb14a78c866a" rel="nofollow">Creating class in new thread in new app domain and providing it with Office COM object in embedded mode leads to zombie process</a></p>