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