How to open a microsoft teams chat in a separate windows from a dotnet project

Copper Contributor

Hi,

I have a desktop application in dotnet 6.

From this application I have created a chat, add members, messages and files.

From there, I open or activate the Teams application.

 

I would like to be able to open the chat into a separate window from the teams application so it stand out to the user.

 

Thank you for your help

 

This is the code I use to open the chat, the part missing is finding a way to open this chat in a separate window.

 

 

public void OpenOrActivateTeams(string chatId)
{
	try
	{
		Process[] processes = Process.GetProcessesByName("ms-Teams");
		string localPath = FileManagementUtility.GetLocalApplicationData();
		string teamsPath = "Microsoft\Teams\current\Teams.exe";
		string path = System.IO.Path.Combine(localPath, teamsPath);

		var process = Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });

	}	
	catch { }
}


}

 

 

 

0 Replies