Microsoft Teams: get process id of video call process

431 Views Asked by At

I am using AutoHotkey to (un-)mute teams calls (OS: Win10Enterprise).
The code looks like that:

LControl & LWin::
;#HotkeyInterval 200

Send ^
WinGet, active_id, ID, A
SetTitleMatchMode, 2
;DetectHiddenWindows, On
WinGet, fensterID, List, ahk_exe Teams.exe
Loop, %fensterID% { ; will run loop for number of windows in array
  WinActivate, % "ahk_id " fensterID%A_Index%
  Send ^+m
}
SoundBeep, 200, 100
WinActivate, ahk_id %active_id%
Return

It loops through all processes called "Teams.exe" and sends the teams-internal Ctrl+Shift+M command. The problem here is, that the call window is always overlayed by later activated teams windows (main chat window), which annoys me. I'd like to solve this, by finding the actual windows process, that is the video call/ contains the video call window.

I found this solution, especially the link to the Get call API. But I have no clue if the given threadID is the one I am looking for.

Any advice on this id or a better solution to (un-)mute teams calls?

1

There are 1 best solutions below

1
On BEST ANSWER

This is a bit tricky to get the current meeting window. The best solution I have found is explained here.

See code in GitHub the Teams Library here