Question

Running a website from asp.net, I need to transfer control (focus) to a winforms application.

In case the application isn't running, I know I can use process.start() method.

But in case the application is running, I don't want to launch a new window.

I have the option to setup the winform application as unique instance, but what if it is a foreign application? I mean if I'm NOT the author and have no control over launching new instances...

How can I find a given window on the client computer and activate it from ASP.NET

Was it helpful?

Solution

Due to security reasons you cannot do it. Code inside browser doesn't have access to user system.

OTHER TIPS

If the browser is Internet Explorer, you could host a .Hta page (or return a content type: application/hta ).

A .Hta page is fully trusted, and can access everything on your local machine through COM. So if can you do it with VBScript, you can do it in a .Hta page.

The user has to trust this "application" before it is downloaded. If this is an Internet application you will probably not get this trust. If this is an Intranet application, you can force the user to trust the page.

I suppose if this was a bit of functionality you really needed you could go down the ActiveX route. Having said that it would only work in IE and would require a separate plugin for firefox (or other brothers) to function.

Honestly though it sounds like overkill for what you are trying to achieve.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top