Skip to content

Commit

Permalink
Update it to work with new (preview) Teams. Bump version to 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pulimento committed Mar 31, 2023
1 parent 5a78f13 commit bf24b0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion WinRemoteControl/Actions/ToggleMuteTeamsAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ class ToggleMuteTeamsAction : IAction

public Result DoAction()
{
Log.Information("Toggling Teams mute");
Log.Information("Trying to toggle Teams mute...");

Process? p = Process.GetProcessesByName("Teams").FirstOrDefault();
if (p == null)
{
// Try with the "new" Microsoft Teams
Log.Information("Classic Teams not found. Trying with the \"new\" one...");
p = Process.GetProcessesByName("ms-teams").FirstOrDefault();
}

if (p != null)
{
IntPtr h = p.MainWindowHandle;
SetForegroundWindow(h);
SendKeys.SendWait("^+{m}"); // CTRL + SHIFT + M
Log.Verbose("Keys were sent to Teams");
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion WinRemoteControl/WinRemoteControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Company />
<Product />
<RepositoryUrl>https://github.com/pulimento</RepositoryUrl>
<Version>1.0.3</Version>
<Version>1.0.4</Version>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
Expand Down

0 comments on commit bf24b0f

Please sign in to comment.