Skip to content

Detecting if app already running and reuse same window if app already running #137

Closed
@Danielx64

Description

@Danielx64

Is anyone decent with c# knowledge here? I managed to build a really web browser based on webview2 (no address bar etc) and I went as far as being able to create a custom url prefix like ms-word. I have been able to get myself to the point where I can run wportal:Hello world! from the commandline and my app will load with a popup (that just for testing, the real thing is that it will get put on the end of a url and start the browser) saying Hello World!. Likewise doing wportal:Hello! will produce a popup with Hello! in it.

What I am wanting to do is only allow one instance of my custom app running at a time and if someone was to click on one of those wportal:xxx link in an email it should bring up the app from the background and head to the new page. Does anyone know how I can go about this?

I started off from this example https://github.com/MicrosoftEdge/WebView2Samples/tree/main/SampleApps/WebView2WindowsFormsBrowser#readme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions