locked
Win32 : window close notification RRS feed

  • Question

  • i am working on a window app, from which i open other windows application like WORD, excell ,etc. using createprocess(). Is there a way so that when the window for this opened application (WORD , EXCEL) closes my winapp gets a notifiaction that it is closed.

    Thursday, September 8, 2005 9:01 AM

Answers

  • You can check if the handle of the process you receive by CreateProcess gets signaled. You can use WaitForSingleObject.
    But!!!
    If the user decides just to close the document or opens other documents than you have no chance to get this info.

    A good way is checking the ROT (Running Object Table), as long as the document is registered in the ROT the user is manipulating or has it open with Word/Excel.
    Note, that this works only for programs that are using the ROT like Word and Excel. It does not work for Notepad!

    Thursday, September 8, 2005 11:05 AM