kjpolker Posted June 19, 2023 Posted June 19, 2023 (edited) As the title suggests, I am looking for a way to keep Microsoft Teams (or any window for that matter) from going idle without intrusively activating it. Is there something that can be done without attempting a ControlClick to the window (initial thought but I am searching for alternative approaches)? I don't even know if a ControlClick would suffice. I am looking for a backend option utilizing the handle, maybe a Windows Message? Just to clear confusion, this is not meant to keep the computer from going idle. Specifically in this situation, Teams has to be active in order to prevent status going idle regardless of being in another window. If I am in the zone or working in another app and I don't activate Teams then I go idle after 5 minutes. It's very annoying. Edited June 19, 2023 by kjpolker
_Func Posted June 19, 2023 Posted June 19, 2023 Is it for the active and online status? why don't you use the web version?
Andreik Posted June 19, 2023 Posted June 19, 2023 On 6/19/2023 at 5:12 PM, kjpolker said: If I am in the zone or working in another app and I don't activate Teams then I go idle after 5 minutes. It's very annoying. Expand For you or for your boss? I think you walk on the grey line of between what is allowed and what is not allowed by forum rules. Basically you try to bypass/hack a functionality of Microsoft Teams.
kjpolker Posted June 19, 2023 Author Posted June 19, 2023 (edited) On 6/19/2023 at 7:40 PM, Andreik said: For you or for your boss? I think you walk on the grey line of between what is allowed and what is not allowed by forum rules. Basically you try to bypass/hack a functionality of Microsoft Teams. Expand I understand that. I definitely get how using this function could prevent a computer from going idle as well as bypass a built-in function, but wouldn't all Window Messages through AutoIt have the same effect? Like using WM_MOUSEMOVE. This is for me and does not violate any work rules. Essentially when idle, calls do not forward to me as I appear away. There are no issues with being idle while on the job but for the sake of keeping my status available for calls without constantly activating Teams I was looking for help. Edited June 19, 2023 by kjpolker
Andreik Posted June 19, 2023 Posted June 19, 2023 (edited) I haven't seen any EULA to state that moving a window is a violation but I won't argue with you on this because we have a competent moderation team. As I said, I don't think you are totally wrong but just think that it would have been easy for Microsoft to made an option to prevent going idle but this is not how the application it's suppose to work. Anyway you might get some help but you didn't said anything about what prevents Microsoft Team going idle. Moving the mouse, window begin active, keys being pressed in app? Edited June 19, 2023 by Andreik typo
kjpolker Posted June 19, 2023 Author Posted June 19, 2023 On 6/19/2023 at 8:15 PM, Andreik said: Anyway you might get some help but didn't said anything about what prevents Microsoft Team going idle. Moving the mouse, window begin active, keys being pressed in app? Expand Understandable. I am not clear on this either to be honest. I know just activating the window works, but since that is not a practical function as I would prefer it to be done in the background then I would assume a simulation of moving the mouse should work. I suppose I was looking for some guidance on if I am on the right track of doing a Windows Message or if there are alternate ways to simulate focusing a window or interaction on a background process. I don't mind doing the research but could use a nudge in the right direction and assistance on working out the syntax (if WM_MOUSEMOVE is the right fit).
Andreik Posted June 19, 2023 Posted June 19, 2023 Usually ControlClick don't need the window to be active. Why you didn't consider this option?
kjpolker Posted June 19, 2023 Author Posted June 19, 2023 I wasn't too excited about performing an actual click as that could in theory select anything depending on the window size and layout. Meaning if I just choose some an arbitrary click location in the middle of the client, it may actually do something.
Andreik Posted June 19, 2023 Posted June 19, 2023 (edited) It doesn't have to be in the middle of the client, it's up to you what to click. It might be a label or something else. I see there is a search input on the app interface. What about using ControlSetText() to set some text in that box every 3 mins or so? Edited June 19, 2023 by Andreik
kjpolker Posted June 19, 2023 Author Posted June 19, 2023 Right, I just didn't want to click anything as that has an actual consequence. The coordinates may be fine but lets say the client size or layout gets changed in the future, it may be clicking on something else or not at all. I was hoping for another approach to simulate activity in a foreground app, but maybe it is not do-able outside of a controlClick?
Andreik Posted June 19, 2023 Posted June 19, 2023 Maybe you are unaware about how ControlClick() it works. It doesn't depend on window size or layout. But first of all take a look with AutoIt Info tool and check what kind of controls do you have there.
rsn Posted June 20, 2023 Posted June 20, 2023 Some years go I was doing something similar and was using ControlSend to send "^!{F12}" to an app to keep it active but not activate it. It'll keep the PC awake as a side effect.
kjpolker Posted June 20, 2023 Author Posted June 20, 2023 On 6/20/2023 at 5:54 PM, rsn said: Some years go I was doing something similar and was using ControlSend to send "^!{F12}" to an app to keep it active but not activate it. It'll keep the PC awake as a side effect. Expand Interesting approach. I suppose that would work well. Although I was hoping for something a bit more robust but that is simple and efficient.
spudw2k Posted June 21, 2023 Posted June 21, 2023 What is it about Teams that is going Idle? Are you talking about the Away status? Reveal hidden contents Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
rsn Posted June 21, 2023 Posted June 21, 2023 @spudw2k Yes the automatic away status. @kjpolker I was poking around trying to apply my past successes onto Teams but Teams is very resistant to my efforts. I think mainly because it identifies as Chrome_WidgetWin_1 and I've 0 experience with UIA. It appears to have some complex activity detection too.
rsn Posted November 28, 2023 Posted November 28, 2023 @kjpolker Late as it is, I found something that seems to work: #include <Timers.au3> HotKeySet("+{ESC}", "_ExitScript") While 1 If _Timer_GetIdleTime() > 30000 Then Local $aPos = MouseGetPos() MouseMove ( $aPos[0]+1 , $aPos[1] ) MouseMove ( $aPos[0] , $aPos[1] ) EndIf Sleep(1000) WEnd Func _ExitScript() Exit EndFunc It'll wiggle the mouse one pixel if the idletimer gets past ~30 seconds.
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