简体   繁体   中英

Is it possible for me to open a native application (Example Microsoft Whiteboard) of windows in my c# windows form application?

Below is an example of how I open Zoom and Teams

private void button2_Click_1(object sender, EventArgs e)
{
    string user = System.Windows.Forms.SystemInformation.UserName.ToString();
    System.Diagnostics.Process.Start("C:/Users/" + user + "/AppData/Local/Microsoft/Teams/current/Teams.exe");
}

private void button1_Click_1(object sender, EventArgs e)
{
    string user = System.Windows.Forms.SystemInformation.UserName.ToString();
    System.Diagnostics.Process.Start("C:/Users/" + user + "/AppData/Roaming/Zoom/bin/Zoom.exe");
}

Note: Unlike Zoom and Teams that when installed they create a folder where we find all the installation supplements, but Whiteboard does not have any folder against these supplements. That's why it's very difficult to open it from my application in C#

Microsoft Whiteboard is a store app.
Here's a Post about How to open Microsoft Store apps from Command Prompt?

You can find these apps here: shell:AppsFolder

From CMD you can start it with

explorer.exe shell:appsFolder\Microsoft.Whiteboard_8wekyb3d8bbwe!Whiteboard

From code it can be started this way:

System.Diagnostics.Process.Start(@"C:\Windows\explorer.exe shell:appsFolder\Microsoft.Whiteboard_8wekyb3d8bbwe!Whiteboard");

Another example can be found here:
https://notepad.onghu.com/2020/launch-win10-app-from-cmdline/

From the code it seems like you just want to start the process, not run it directly on your winform app. By default, applications downloaded from Microsoft Store are stored in C:/Program Files/WindowsApps .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM