DonationCoder.com Software > Finished Programs
DONE: IdleClose - exit certain programs after x minutes of idle time
brotherS:
Hi,
I'd love a little tool to automatically close certain programs after I haven't used them for x minutes. I'm not sure if that's an easy task or not, but I could really use such a tool to auto-close some programs!
It would be perfect if I could specify the number of minutes for each program/exe after which IdleClose should kick in.
Gerome:
Hi,
If you gimme the name of the API that allows to retrieve the Status of a running program, i can make a sample to demonstrate easily how to do this job :)
allen:
. . . and if it could automatically click "save" when the program pops up asking if you'd like to, it'd be even smarter :D
brotherS:
Hi,
If you gimme the name of the API that allows to retrieve the Status of a running program, i can make a sample to demonstrate easily how to do this job :)
-Gerome (February 09, 2006, 04:20 AM)
--- End quote ---
Err... sorry, no idea...
. . . and if it could automatically click "save" when the program pops up asking if you'd like to, it'd be even smarter :D
-allen (February 09, 2006, 07:01 AM)
--- End quote ---
Hehe... I would use it only for programs that don't need to save anything. :)
jgpaiva:
The good news is: THIS CAN BE DONE!
And actually, is a nice idea.
I just made a small sketch on how to do it in ahk:
--- ---;IdleClose
WinGet, id, list,,,Program Manager
WindowList =
Loop, %id%
{
StringTrimRight, this_id, id%a_index%, 0
WinGetTitle, this_name, ahk_id %this_id%
if this_name !=
{
MsgBox, the name is: %this_name%`nand it has this id: %this_id%
;£ divides the srting for the several programs existing
;§ divides the string between {ahk_id} and {time_idle}
windowlist =%windowlist%£%this_id%§0
}
}
Loop, Parse, WindowList, £
{
Loop,Parse, A_LoopField,§
{
If A_Index = 1
Id =%A_LoopField%
else
MsgBox, Id: %Id%`nidle time: %A_LoopField%
}
}
return
The code above lists all windows that exist (and have name!!), and puts their ids to a list, folowed by another parameter, that will be used to put the time idle. After that, it runs through that list, and gets the ids and time idle again.
I launched this code, because i need to know if it finds the windows you'd like it to find. In my computer, it found every window i had open, please run it in yours and tell me if something is missing!
The problem is, that i don't think you'd like it to close every window, possibilly it should leave some windows open.
And i still don't know how to handle a small thing that was forgotten in this post: how about when you go away, and leave the pc? When you return, it'd have closed all the programs you have. Maybe the concept should be redefined.
I'll try to do this program today during the afternoon, I'll keep you posted ;)
Navigation
[0] Message Index
[#] Next page
Go to full version