- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quicktime application seems to forget its parent window. If I start my application from a console window, and I abruptly kill the console window, the quicktime application is not stopped which should be the behavior since it's a child process from the console window.
Stopping the quicktime application gives back the hand to the console so this one knows its child.
Is there any way to change the behavior: compilation or quicktime option?
Olivier
Stopping the quicktime application gives back the hand to the console so this one knows its child.
Is there any way to change the behavior: compilation or quicktime option?
Olivier
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correction: read Quickwin instead of quicktime!
Olivier
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Win32 in general does not have "child processes", at least not in the Unix sense (was it
You can "outsmart" the killing in other ways:
a) SetConsoleCtrlHandler() in parent application, which should be called at the moment when user presses Ctrl+C or tries to close the console window (I think that only killing from Task Manager/Processes would workaround it) and do a SendMessage(WM_CLOSE) or TerminateProcess for QuickWin process.
b) Let the QW app's PROGRAM end in WaitForSingleObject(hProcess, INFINITE) where hProcess is handle of "parent" process. You may pass hProcess to the child through its command line for instance.
Jugoslav
fork?). "Child" process really has a very weak relationship with the parent. So, the problem has nothing specific with QuickWin.You can "outsmart" the killing in other ways:
a) SetConsoleCtrlHandler() in parent application, which should be called at the moment when user presses Ctrl+C or tries to close the console window (I think that only killing from Task Manager/Processes would workaround it) and do a SendMessage(WM_CLOSE) or TerminateProcess for QuickWin process.
b) Let the QW app's PROGRAM end in WaitForSingleObject(hProcess, INFINITE) where hProcess is handle of "parent" process. You may pass hProcess to the child through its command line for instance.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your answer, but actually my main trouble is not about killing the child application. I really do need that child-parent relation between both applications. When my child application stops, it creates an environment variable, let's say ERRORLEVEL, to indicate the way it has ended.
My DOS script can use that feedback for the next steps. However since the QW application lost its parent, when the child process stops, the environment variable is deleted (I'm using NT4) and I always get the value 0 for the ERRORLEVEL variable.
If I build my application with the WATCOM77 compiler, the behavior is fine. I think that a process launched from a DOS console is always a child and it's still the case with my QW application since the script stops executing till the child process terminates.
Furthermore, I can't get the handle of a DOS console windows without advanced programing!
My DOS script can use that feedback for the next steps. However since the QW application lost its parent, when the child process stops, the environment variable is deleted (I'm using NT4) and I always get the value 0 for the ERRORLEVEL variable.
If I build my application with the WATCOM77 compiler, the behavior is fine. I think that a process launched from a DOS console is always a child and it's still the case with my QW application since the script stops executing till the child process terminates.
Furthermore, I can't get the handle of a DOS console windows without advanced programing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, thanks Jugoslav, you must be right about WIN32 application. I will have to find other ways!
Olivier
Olivier
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page