How could a separate program know when the users are done using this application? For that matter, how would the application itself know that the users are finished and aren't simply idle (or doing something else) for 30 seconds?
If you are having an issue where your users are not closing a program when they should, I recommend implementing a policy similar to what we use at my office. We use an office management program that locks client files open when the program is open so that those files cannot be backed up, even using shadow copies. The files remain locked if the program is forced to close by Task Manager or anything similar.
Some users frequently "forgot" to close it so the boss decided to make it policy that if someone does not close the program when they leave for the night (causing the backup to fail) they have to put a quarter in a jar. Those quarters are added to the budget to buy snacks at the weekly office meeting for everyone who did not have to "donate" that week. Quarters don't really buy much, of course, but it's enough to help people remember to close the program. People still forgot frequently for a while, but there have been very few failed backups lately.
In short, don't try to solve a personnel/training problem with software...