Version 0.0.1.3 Beta is now available here:
http://rainmeter.net/forum/viewtopic.php?p=92974#p92974
moshi wrote:in what i was trying to say it doesn't really matter whether a program is hidden or not.
usually when you try to start a program a second time, you get a 101 error.
if you refresh the skin though, you do not get this error and the program can be launched a second time, or a third time after an other refresh.
a OnCloseAction has no effect here as it is not executed on a refresh.
a OnRefreshAction doesn't help either as you would just get a 102 error.
this is a serious flaw in my opinion as a refresh can happen any time, be it only from using the RainFile file picker from an other skin.
I changed the behavior a little bit on this version. Previously, if the
Timeout value was reached (if defined), then the program would terminate immediately like the
Kill command. This really isn't correct behavior since the user should be asked if they want to close the program. So starting in version "0.0.1.3", if a
Timeout value has been reached, the program will attempt to exit cleanly (eg. like the
Close command). Of course if the program is in the
Hide state, it is terminated via the
Kill command.
The same thing thing goes for when the skin is unloaded (or Rainmeter is exited). Since we are associating a program with a skin, it only makes sense to attempt to close that program if the skin is unloaded. Even if the program cancels the close of the program, the plugin no longer associates with the program anymore. Also, I incorrectly assumed that Rainmeter would make a new "window" on refresh, but it doesn't - it just uses the same window while unloading the plugin and re-loading it (ie. all the plugin data is lost).
So basically:
Pre-0.0.1.3: If the
Timeout is reached, the program terminates via
Kill. If the program is still running when the skin closed, it was only terminated via
Kill if in the
Hide state. If the skin was refreshed, the program still ran like nothing happened.
0.0.1.3+: If the
Timeout is reached, the program terminates via
Close unless hidden, then via
Kill. If the program is still running when the skin closed
or refreshed, it terminates via
Close unless hidden. If any program prevents itself from closing (like cancelling any changes in Notepad), the plugin will not keep running and stop expecting any output (the
Kill or
Close commands should no longer work either).
CPU usage when the program is running should be greatly diminished with this version.
-Brian