What works is clicking on this tiny overlaied windows and get the original meeting window back on the screen.
I´ve tried to use "Window Spy", which didn´t helped me at all :(
; -------------------------------------------------------------------------------------------------------------------
Teams_GetMeetingWindow(Mode :=0, Activate:=false){
; Syntax: hwnd := Teams_GetMeetingWindow(Mode:=0)
; UIAEl := Teams_GetMeetingWindow(Mode:=1|2,Activate:=true|false*)
; If window is not found, hwnd is empty
; Mode=1: return Call in progress Share window
; Mode=2 return Meeting window even if Call in progress Share Window
; See implementation explanations here:
; https://tdalon.blogspot.com/2022/07/ahk-get-teams-meeting-win.html
UIA := UIA_Interface()
WinGet, Win, List, ahk_exe Teams.exe
Loop %Win% {
WinId := Win%A_Index%
TeamsEl := UIA.ElementFromHandle(WinId)
If IsMeetingWindow(TeamsEl) {
if (Mode = 0)
return WinId
Else
return TeamsEl
}
If RegExMatch(TeamsEl.Name,"Microsoft Teams Call in progress.*") {
If (Mode =1) {
if Activate
WinActivate, ahk_id %WinId%
return TeamsEl
}
Else If (Mode = 2) {
El:= TeamsEl.FindFirstByNameAndType("Call is in progress", "text", , 1) ; partial match
If El {
El.Click()
Sleep 500
TeamsEl := Teams_FindMeetingWindow(Activate)
return TeamsEl
}
}
}
;MsgBox % TeamsEl.DumpAll()
} ; End Loop
TrayTip, Could not find Meeting Window! , No unminmized active Teams meeting window!.,,0x2
} ; eofun
; -------------------------------------------------------------------------------------------------------------------
Teams_FindMeetingWindow(Activate:= false) {
; Loop through Teams.exe Window to find Meeting Window
; Try multiple times untill it is found
UIA := UIA_Interface()
Loop, 3 {
WinGet, Win, List, ahk_exe Teams.exe
Loop %Win% {
WinId := Win%A_Index%
TeamsEl := UIA.ElementFromHandle(WinId)
If IsMeetingWindow(TeamsEl) {
if Activate
WinActivate, ahk_id %WinId%
return TeamsEl
}
}
Sleep 500
}
TrayTip, Could not find Meeting Window! , No unminmized active Teams meeting window!.,,0x2
} ; eofun
; ---------------------------------------------------------
IsMeetingWindow(TeamsEl,Active:= true){
if (TeamsEl.FindFirstBy("AutomationId=meeting-apps-add-btn") or TeamsEl.FindFirstBy("AutomationId=hangup-btn") or TeamsEl.FindFirstBy("AutomationID=microphone-button"))
if (Active)
return !TeamsEl.FindFirstByName("Resume") ; Exclude On-hold meetings with Resume button
return false
} ; eofun
; MICROSOFT TEAMS - Toggle Mute
+^!M::
WinGet, PrevWinId, ID, A ; Save the current window ID
WinId := Teams_GetMeetingWindow()
if (WinId <> "")
{
WinActivate, ahk_id %WinId%
SendInput ^+m ; toggle mute Ctl+Shift+m
Sleep 200
WinActivate ahk_id %PrevWinId% ; Restore previous window focus
}
;else
; MsgBox, 1: WinIdValue (%WinId%)
It would be great to enhance the script to find this little window. Or give me an advice how to find out the window-title and/or button name.
Thanks a lot in advance!