Diana (Cda) Posted July 14, 2008 Share Posted July 14, 2008 have a situation where an app goes into sleep mode and there is nothing I can change in terms of settings to get more than the 10 minutes of idle that triggers the sleep. Sleep mode isn't, in and of itself, is not so much a problem, it's just that the application shuts down and alerts, etc., stop. Is there a way to keep the app "active" without giving it any "focus" (hope I have right term). What I tried is I did up a looping script and put in a WinActivate delayed to a test of every 5 seconds (which I'd later change to 30 seconds). Well, d'uh, not very bright even though I was just fooling around to see what I knew to do. WinActivate may or may not prevent the sleep mode being activated but I never realized that it actually does pop the window up physically, too. <d'uh, again <g>> I did a search in the forum and the help file but I'm bringing up completely unrelated things. I'm guessing that it's a function that I perhaps haven't yet learned. Can anyone recommend an AI feature to keep an app active without having it come to the forefront; that it runs silently in background without impacting on user? Thanks! muttley Link to comment Share on other sites More sharing options...
JFee Posted July 14, 2008 Share Posted July 14, 2008 Not 100% sure of what you are meaning by "sleep mode", but try hiding the GUI with GUISetState(@SW_HIDE) Then you can use GUISetState(@SW_ENABLE) to give it focus without it being visible Regards,Josh Link to comment Share on other sites More sharing options...
Diana (Cda) Posted July 14, 2008 Author Share Posted July 14, 2008 Not 100% sure of what you are meaning by "sleep mode", but try hiding the GUI with GUISetState(@SW_HIDE) Then you can use GUISetState(@SW_ENABLE) to give it focus without it being visibleHi, thanks for responding! <g> Is there an equivalent for GUISetState for apps, vs. AI? I'm not very experienced yet but it seems to me that this only works for GUIs and not apps. I only can think of using @SW_ENABLE with things like ShellExecute. Since the action needs to be done on an already opened app, can't see how this would work, though. If it could be done, is action of HIDE and then ENABLE the only way to "activate" an app without having the action visible so that it is stopped from going to sleep on idle time from using it? (Sleep mode not dependent on computer idle, funnily enough. It's a few short minutes on not using it that this happens. Problem is not the sleep mode but the fact that alerts and notifications all stop!) Thanks. muttley Link to comment Share on other sites More sharing options...
JFee Posted July 14, 2008 Share Posted July 14, 2008 Try looking things up in the helpfile first.... winsetstate Regards,Josh Link to comment Share on other sites More sharing options...
Diana (Cda) Posted July 14, 2008 Author Share Posted July 14, 2008 (edited) Try looking things up in the helpfile first....winsetstateFirst, let me unclench my teeth ...I checked the help file, for what that was worth. Not knowing the terminology of what I'm looking for is like trying to look up a word in the dictionary without having a word there, either. If I knew what the hell I was looking for, then, yes, the help file would be a better resource. But checked forums first, then help but didn't get a glimmer of a solution.WinSetState is something I use all the time. It will _not_ do the job here. "WinSetState: Shows, hides, minimizes, maximizes, or restores a window."A program is going into sleep mode repeatedly with negative consequences. I literally have to be at my desk, and reading something in the damned files for it to not go dormant and lock up. I need something that will keep the program alive non-obtrusively, not restore a window, etc. I thought, because of the "Activate" in WinActivate that that might do the trick but all it does is pop the window up again and again, intrusively and not what was needed. AI can do practically anything, I've found, if you know what it is you need to do and have enough AI knowledge to do it. I'm working on the latter all the time but don't know the former here. Hence this post. Edited July 14, 2008 by Diana (Cda) Link to comment Share on other sites More sharing options...
Skruge Posted July 14, 2008 Share Posted July 14, 2008 Diana, Try to find out what kind of user input keeps the app "alive". For example, Send text to an edit field, then delete it Send "F5" or click "refresh" Click a button, field, or blank part of the window ControlSend, ControlClick, ControlCommand, and _MouseClickPlus can all be done without stealing focus. The problem is, it all depends on the app in question. If you're not sure what to try first, use WinGetClassList or the AutoIt Window Info tool to see what controls are available. Good luck! [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Diana (Cda) Posted July 15, 2008 Author Share Posted July 15, 2008 Diana,Try to find out what kind of user input keeps the app "alive".For example,Send text to an edit field, then delete itSend "F5" or click "refresh"Click a button, field, or blank part of the windowControlSend, ControlClick, ControlCommand, and _MouseClickPlus can all be done without stealing focus.The problem is, it all depends on the app in question.If you're not sure what to try first, use WinGetClassList or the AutoIt Window Info tool to see what controls are available.Good luck!Hey, wow, this is great! Thank you so much for the large number of possibilities to try.Yes re the issue at hand. I haven't even figured it out myself manually, so that is indeed a good thing to see what will work so that I can then figure out an AI solution to do the same programmatically.Thank you! muttley Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now