Jump to content

Recommended Posts

Posted (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 by kjpolker
Posted
  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. :pirate:

Posted (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. :pirate:

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 by kjpolker
Posted (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 by Andreik
typo
Posted
  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).

Posted

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.

Posted (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 by Andreik
Posted

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?

Posted

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.

Posted

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.

Posted
  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.

Posted

@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.

  • 5 months later...
Posted

@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. 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...