Welcome Guest.   Make a donation to an author on the site October 01, 2014, 03:22:13 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2014! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: utility to close a program after the program has been idle for x minutes  (Read 7450 times)
go197
Participant
*
Posts: 12

View Profile Give some DonationCredits to this forum member
« on: December 20, 2006, 11:08:55 PM »

I keep my email .pst file and my MS OneNote data inside an encrypted "drive" that closes itself after 15 minutes of no read/write activity to the "drive".  I have always wanted a utility that I could set up to close out Outlook and/or OneNote 1 minute before the encrypted "drive" closes.  This way I could avoid the programs becoming non-responsive and/or the PC blue screening when I try to reopen the drive.
This kind of utility could be useful for anyone who might want a program to close by itself for other reasons, like password protected files (Word, Excel, etc) or other password protected apps. 
It might also be useful if it could close programs due to screen saver activation, hibernation, or stand-by.
I hope this sounds interesting to you guys, I think it could be useful.
Thanks in advance...
« Last Edit: December 22, 2006, 04:40:02 AM by brotherS » Logged
go197
Participant
*
Posts: 12

View Profile Give some DonationCredits to this forum member
« Reply #1 on: December 20, 2006, 11:27:00 PM »

OP here.  I was looking through the finished programs in this forum after I posted the above request (should've been more thorough to begin with  embarassed ...sorry Cry) and found this:
http://www.donationcoder....um/index.php?topic=2377.0
This might be what I've been looking for.  I'll look at it and see if it will work for my situation.
Logged
brotherS
Master of Good Ideas
Honorary Member
**
Posts: 2,105


To make a difference, be different.

View Profile Give some DonationCredits to this forum member
« Reply #2 on: December 21, 2006, 02:26:32 AM »

http://www.donationcoder....um/index.php?topic=2377.0
This might be what I've been looking for.  I'll look at it and see if it will work for my situation.
Yep, my script at the end of that thread should do exactly what you want. If you can't get it to work for your program(s), please reply there.
Logged

Thank you.
go197
Participant
*
Posts: 12

View Profile Give some DonationCredits to this forum member
« Reply #3 on: December 21, 2006, 10:57:45 PM »

Thanks for your reply.  Yes it works with outlook.exe and onenote.exe,  but I've found after testing it and reading about the A_TimeIdlePhysical command in the help file that it's not exactly what I'm looking for.  I am looking for a utility that monitors the idle time of only specific programs (instead of the whole system) and that would then close those programs after x minutes of program idle time.  I can see that this script you wrote is useful for many purposes, but it's not really what I am needing.  I'm looking for a solution to close Outlook and OneNote before Truecrypt's "auto-close on x minutes with no read/writes" feature closes the "drive" where their data is located because this "drive" closing causes problems as I mentioned above.  I don't know if you're familiar with the Truecrypt feature I'm refering to, so if you need me to elaborate a little, I can.  Is there anything that can be done with Autohotkey that could help with my situation?
Logged
brotherS
Master of Good Ideas
Honorary Member
**
Posts: 2,105


To make a difference, be different.

View Profile Give some DonationCredits to this forum member
« Reply #4 on: December 22, 2006, 04:39:36 AM »

Is there anything that can be done with Autohotkey that could help with my situation?
It's AutoHotkey: of course! smiley

I imagine something like "check if PROGRAM's window is active" (If WinActive, check out http://www.autohotkey.com/docs/commands.htm) - if it hasn't been active for x minutes -> close PROGRAM.

Some of the more experienced AutoHotkey users here can probably help you with more details.
Logged

Thank you.
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: December 22, 2006, 09:16:10 AM »

Just let me straighten out some stuff: The time that it'd wait before closing the programs would be the same for all of them, right?
Also, would you like it to close the program's windows or to terminate the processes?
Logged

go197
Participant
*
Posts: 12

View Profile Give some DonationCredits to this forum member
« Reply #6 on: December 22, 2006, 02:23:20 PM »

I imagine something like "check if PROGRAM's window is active" (If WinActive, check out http://www.autohotkey.com/docs/commands.htm) - if it hasn't been active for x minutes -> close PROGRAM.
Would this work if the Outlook window was the only window open?  If not, then I guess I'm needing something that monitors the activity (or lack of it) happening with the program or maybe there is a creative way to get the same effect.

Just let me straighten out some stuff: The time that it'd wait before closing the programs would be the same for all of them, right?
Yes, that would work for me since any i/o to the "drive" resets the "drive's" idle timer.  For example, if Outlook and OneNote were both open but I was only doing anything in Outlook, that would be enough to keep the "drive" open and therefore OneNote is safe from the "drive" closing too.

Also, would you like it to close the program's windows or to terminate the processes?
A nice gentle "close" would be best I guess, if that's an option.
« Last Edit: December 22, 2006, 10:21:38 PM by go197 » Logged
go197
Participant
*
Posts: 12

View Profile Give some DonationCredits to this forum member
« Reply #7 on: December 27, 2006, 08:49:51 AM »

Well this has been dropping down the list, so does that mean that it isn't possible with AHK?
Logged
brett
Charter Member
***
Posts: 125



Australia

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #8 on: December 27, 2006, 01:49:46 PM »

Just a thought

Your problem is having a program still running that can no longer access the drive, because the drive has disconnected due to lack of activity.

It would not be to hard to have a AHK script send a tiny write/delete to the encrypted drive every 'x' minutes whenever Outlook/Onenote is open (IfWinExists)
Keeping the encrypted drive active until you close Outlook/Onenote

is this a option ?

..dB..
doublebogey
« Last Edit: December 27, 2006, 01:51:52 PM by doublebogey » Logged
go197
Participant
*
Posts: 12

View Profile Give some DonationCredits to this forum member
« Reply #9 on: December 27, 2006, 05:31:16 PM »


Just a thought

Your problem is having a program still running that can no longer access the drive, because the drive has disconnected due to lack of activity.

It would not be to hard to have a AHK script send a tiny write/delete to the encrypted drive every 'x' minutes whenever Outlook/Onenote is open (IfWinExists)
Keeping the encrypted drive active until you close Outlook/Onenote

is this a option ?

..dB..
doublebogey


Well, that is a good idea  cheesy, but I want the drive to close to protect my data, so I'd rather the drive close itself for security.
But thank you...

Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #10 on: December 27, 2006, 06:17:53 PM »

 smiley I didn't read the whole request, and figured you wanted to use the prosess' CPU usage, but here's an attempt.

IdleClose - Closes programs that's not been activated for x minutes

It's a bit rough around the edges, as it tries to close the same program several times if it has several windows, and a few other things, but I'll correct it when I write a GUI for it tomorrow.

It is set to close any windows not accessed within 1 minute, but it asks first, and if you say No, the window is ignored in the future. You can change the list of ignored programs, and also kill programs instead of just trying to close them.

Skrommel

;IdleClose.ahk
; Closes programs that's not been activated for x minutes
;Skrommel @2006
...
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
go197
Participant
*
Posts: 12

View Profile Give some DonationCredits to this forum member
« Reply #11 on: December 27, 2006, 08:18:16 PM »

Looking good Skrommel beerchug!!
Before you get too far can I throw out a few thoughts for design?  (I don't need all of these features, but maybe someone else might be able to use them) 
Maybe have a list of specified apps for it to monitor while all others are ignored
Maybe be able to choose whether to display the "Really close?" dialog for each app
Maybe have a "Snooze" option on the "Really close?" dialog
Maybe have options to also close the programs on hibernate, stand-by, and screen-saver
Also, with the aim of flexibility, maybe give the option of (instead of killing a process or closing a program) setting it to run a program or batch file
My  two cents ...



« Last Edit: December 27, 2006, 08:38:00 PM by go197 » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.051s | Server load: 6.64 ]