First post, by Kahenraz
- Rank
- l33t
I would normally write something like this using a shell script or with some other minor dependency, but I wanted to remove as much noise as possible from the testing process. If the system becomes unstable, is it the program you opened or is it a bug in the glue that made it happen?
This program is extremely simple and simply opens a program repeatedly and closes it by sending a WM_CLOSE message to the top level window owned by that process (this is the same as pressing the X button on the window frame). It should only send this message once per window, but it won't stop checking for additional windows owned by the process in the event the first window was a splash screen or some other "non-program window", for example, the Kodak Image Viewer for Windows 98.
I am using the WM_CLOSE message specifically to provide a program with the most graceful of an opportunity to free any resources it might have allocated and terminate itself, rather than doing so forcefully with TerminateProcess(). Please note that it is possible that this tool could cause a program to crash, as it is sending a message faster than humanly possible, and this might create a problem where the program is instructed to tear itself down before it's finished building itself up. Clearly, this is not something that a normal human could ever do.
This program accepts a single argument, which is the name of the program to be run. It uses Windows's default search path mechanics, so you should only need to use something like "notepad.exe" or "kodakimg.exe" instead of the full path if it can already be found by Windows.
If you want to stop the test from running, press the Escape key.
Tested on Windows 98 Second Edition. It should work on Windows 95, but I haven't tried it there.