m^(2) wrote:
Not all programs have close buttons. Or visible windows. And my program doesn't receive WM_CLOSE.
The program doesn't actually have to have a close button to send it a close command (and have it succeed, at least as far as I've seen), however, the program has to have a registered window handle (even if the window isn't visible). So the first two don't matter that much as long as the program at least has an invisible window, some don't though, and there doesn't seem to be anything I can do about that other than fall back on a forceful termination.
When you say your program doesn't receive it, do you mean EjectUSB fails to send it a close command? Does it fit the previous criteria (have at least 1 window, even invisible)?
If a program is, let's say, a portable launcher that runs a program then waits for it to close, you can add the launcher executable to the exclusions list (that's the primary purpose of the exclusions list). This way, when EjectUSB closes the program the launcher is waiting for, the launcher will close automatically and not be terminated (unless it takes too long to close). If the launcher needs more time to clean up, that's what the TimeToWait value is for, and it can be increased to give it more time.
guinness wrote:
Oh and where do I find handle.exe which is lower than 1.20? as i can only find 1.40?!
It's pretty damn hard to find versions of Handle older than the current 3.40. Due to license issues with Handle, I can't redistribute, nor should I probably even link to older versions, but I'll tell you I've found versions 3.10, 3.20 and 3.30 by using Google. I think 3.30 was in an anti-malware collection Torrent, 3.20 was was in someone's personal FTP directory, and I can't remember where I found 3.10. 3.20's the best in my opinion.
Queue