home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / misc / 1565 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.7 KB  |  43 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!wupost!eclnews!swarm.wustl.edu!wilcox
  3. From: wilcox@swarm.wustl.edu (Don Wilcox)
  4. Subject: Re: NotifyRegister() question
  5. Message-ID: <1992Aug28.152048.28526@wuecl.wustl.edu>
  6. Sender: usenet@wuecl.wustl.edu (Usenet Administrator)
  7. Nntp-Posting-Host: swarm
  8. Organization: Washington University in St. Louis, MO
  9. References: <1992Aug27.173716.17324@franz.com>
  10. Date: Fri, 28 Aug 1992 15:20:48 GMT
  11. Lines: 30
  12.  
  13. In article <1992Aug27.173716.17324@franz.com> sdj@franz.com (Steve D. Jacobson) writes:
  14. >I would like to invoke WinExec() and then wait in a temporary GetMessage()/
  15. >DispatchMessage() loop until the application invoked by WinExec() terminates.
  16. >
  17. >I am trying to use the toolhelp DLL NotifyRegister() function to do this.
  18. >
  19. >By looking for a NFY_EXITTASK notification, I can tell that some application
  20. >has completed, but I can't tell that it's the one I'm interested in. The
  21. >other things I've tried, like looking to see if the NFY_DELMODULE handle
  22. >matches the return value I get from WinExec(), don't work.
  23. >
  24. >Has anyone out there tried to do something like this and figured out what
  25. >notifications to look for?
  26. >
  27. >Thanks,
  28. >
  29. >Steve
  30.  
  31. What I have done when I needed this is to keep the HINSTANCE that WinExec
  32. returns, and look it up in a TaskFirst/TaskNext loop.  That can give you a
  33. task handle.  Then, every time I get a NFY_EXITTASK, I PostMessage to another
  34. window which does an IsTask() in the task handle.  If I get false, then my app
  35. has exited, and I can continue.
  36.  
  37. Don
  38.  
  39. -- 
  40. Don Wilcox                         | "For I am not ashamed of the Gospel of
  41. Washington University in St. Louis |   Christ, for it is the power of salvation
  42. email: wilcox@swarm.wustl.edu      |   to all who believe."
  43.