Shayo
Shayo

Reputation: 23

Closing Web-browser from WinRT app (c#)

Is there a way to close a browser from my WinRT app? (C#)

Why I want that? I have a web-page that redirects to my app when I open it. the app indeed opens (by protocol activation) but I want to close the browser since there is no use for it. Is there a way? Thanks

Upvotes: 0

Views: 66

Answers (1)

Jerry Nixon
Jerry Nixon

Reputation: 31813

No. There used to be a way when there was a supported method called ApplicationView.TryUnSnap(). But that method is no longer supported. I mean, it's now deprecated:

// Deprecated:
//     TryUnsnap may be altered or unavailable for releases after Windows 8.1. Apps
//     can be continuously resized, but cannot be snapped, starting in Windows 8.1.
//     Also, ApplicationView static methods may be altered or unavailable for releases
//     after Windows 8.1. Use ApplicationView.GetForCurrentView to get an instance
//     of ApplicationView.

Once your app invokes a launcher, it hands off control from the app to the whatever handles the launchers action. In this case, you are using LaunchUri() which hands off to whatever handles the http: protocol on your system. Usually this is Internet Explorer.

Sorry for the superfluous explanation there. The quick answer is no.

Best of luck!

Upvotes: 1

Related Questions