|
|
| ale5000 |
| Posted: Feb 26 2015, 01:54 PM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
[mod note: split from test5 thread]
There is a peculiar bug: If I send PostMessage(winHwnd, WM_CLOSE, 0, 0) to VirtualDub when it is on the "VirtualDub Program Failure" windows it open the "VirtualDub Program Failure - Detail" window instead of exiting; instead sending it to the "VirtualDub Program Failure - Detail" actually crash the crash handler.
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| dloneranger |
| Posted: Feb 26 2015, 03:40 PM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
It's not a bug, you're sending a close message to virtualdub when it's got a modal dialog open Normally this does not happen eg open the filters list and try clicking on virtualdubs close button You could rewrite the code in the projectui.cpp message handler for wm_close to shut down extra windows, or as that's probably doomed to failure (as you'd have to cover all possible open dialog windows) enumerate down the list of dialogs that virtualdub has open and close them from the bottom up (some dialogs have their own ones as well)
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ale5000 |
| Posted: Feb 26 2015, 05:04 PM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
Regarding the crash, maybe then it is better to ignore WM_CLOSE in situations where it can't be easily done (open dialog windows) instead of this random behaviour.
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| shekh |
| Posted: Feb 26 2015, 05:15 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14

|
Why are you sending the message? I am not sure but probably WM_CLOSE is not leagal message for a disabled window. If you begin sending random messages everything will crash. |
 |
| ale5000 |
| Posted: Feb 26 2015, 06:48 PM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
Just a last explanation. I send WM_CLOSE from an external program because I need VirtualDub closed. It would be nice if it close if it can or not close if it can't but it would be nice if it isn't crash or open window with WM_CLOSE.
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| dloneranger |
| Posted: Feb 26 2015, 08:04 PM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
Well, you can start virtualdub with the /h switch which will disable the crash reporting dialog But... you'll still get the windows error reporting one (unless you've disabled that)
But really the best way to do it, is to do it properly http://support.microsoft.com/kb/178893 So, you find virtualdubs window, enum it to find any top level children windows, recurse until you've found the last one and close them from the bottom up
When you're emulating a person then you have to do it how it can be done eg you physically can not click the close button of virtualdub when a modal dialog is open why doest windows let you do this? because it's to stop users doing just what you've tried and having their programs crash in mysterious ways
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ale5000 |
| Posted: Feb 26 2015, 11:13 PM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
Thanks for the help but I'm doing an installer for VirtualDub, that detect if it is active and close it, it is not opened by me, so official VirtualDub need to be fixed. This is a bug report, not a request for help.
Maybe VirtualDub can "ignore" WM_CLOSE when it can't be closed, crashing is always a bug. I would be fine if it would do in this way: 1) If it can easily exit then exit 2) When it cannot easily exit just ignore WM_CLOSE
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| dloneranger |
| Posted: Feb 27 2015, 05:27 AM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
If you have to kill it dead with fire TerminateProcess it
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ale5000 |
| Posted: Feb 27 2015, 05:44 AM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
Well I prefer to "ask to virtualdub" to close, if it can't because is doing something it can reply no and I show a message to the user (to avoid interrupt important things).
It ignore WM_QUERYENDSESSION and WM_ENDSESSION that are messages that Windows send at shutdown to all applications and it is bad. Apparently works with WM_QUIT. But I'm not sure if it exit cleanly.
There is a special message to exit from this app safely? Or can it be added?
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| dloneranger |
| Posted: Feb 27 2015, 06:07 AM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
It could be added as a req It'd have to do the same steps of tracking down its open dialogs and closing them all
But.....you're still stuffed unless every virtualdub you're updating is already the newest one that does what you want?? Then you're back to closing them all yourself, terminating it, asking the user to do it and waiting until they do or the good old restart your pc to replace the in use file
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| ale5000 |
| Posted: Feb 27 2015, 06:16 AM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
It wouldn't be a problem, I can use the good method with new VirtualDub, and then if it is still opened use the "dirty method" for old VirtualDub.
Maybe can be added a custom message that old VirtualDub simply ignore.
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |
| shekh |
| Posted: Feb 27 2015, 11:34 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 89
Member No.: 37903
Joined: 21-April 14

|
I think installer terminating a program is something wrong from the user point of view. This is normal only if the program is service with no important state. The expected and well known way is simply ask the user to close program before installing and upon file copy error. |
 |
| ale5000 |
| Posted: Feb 27 2015, 08:28 PM |
 |
|

Advanced Member
  
Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07

|
If it doesn't detect it running it won't do anything. If it detect VirtualDub running it ask to the user if he/she want that setup close it automatically, the user can also say No or close it manually before responding.
If you want to try, it is here: http://forums.virtualdub.org/index.php?act...=ST&f=3&t=23203
-------------------- New VirtualDub forum VirtualDub AIO (All-in-One installer for VirtualDub and plugins) Codec Toolbox RS (A tool to read/change merit of codecs and many other things) Input plugins for VirtualDub / ACM codecs / VFW codecs |
 |