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

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!heathh
  3. From: heathh@cco.caltech.edu (Heath Ian Hunnicutt)
  4. Subject: Re: NotifyRegister() question
  5. Message-ID: <1992Aug27.233103.624@cco.caltech.edu>
  6. Sender: news@cco.caltech.edu
  7. Nntp-Posting-Host: punisher
  8. Organization: California Institute of Technology, Pasadena
  9. References: <1992Aug27.173716.17324@franz.com>
  10. Date: Thu, 27 Aug 1992 23:31:03 GMT
  11. Lines: 29
  12.  
  13. sdj@franz.com (Steve D. Jacobson) writes:
  14.  
  15. >I would like to invoke WinExec() and then wait in a temporary GetMessage()/
  16. >DispatchMessage() loop until the application invoked by WinExec() terminates.
  17.  
  18. >I am trying to use the toolhelp DLL NotifyRegister() function to do this.
  19.  
  20. >By looking for a NFY_EXITTASK notification, I can tell that some application
  21. >has completed, but I can't tell that it's the one I'm interested in. The
  22. >other things I've tried, like looking to see if the NFY_DELMODULE handle
  23. >matches the return value I get from WinExec(), don't work.
  24.  
  25.     When you get the NFY_EXITTASK notification, one of the parameters
  26. that is sent to your notification callback is the handle of the exiting
  27. task.  You should check to see if this parameter matches the return
  28. value from WinExec().
  29.  
  30.     One final note:  You will probably want to store the return value
  31. from WinExec in some sort of global variable.  That is fine, but often
  32. when your notification callback gets called, you will be on someone
  33. else's stack and in someone else's DGROUP.  So, you will probably
  34. want to cpmpile your program in large model, so that your
  35. references to the global variable will be via FAR pointers.
  36. As an alternative, you could use a DLL.
  37.  
  38.  
  39. -- 
  40. On Saturday, April 18, 1992, this .sig became self-aware.
  41.  
  42.