stighy
stighy

Reputation: 7170

.Net: How to run a local application via a remote desktop application

this is my scenario:

i need to allow user to click an Ax button and run a local application (say Outlook).. not remote, but from user pc.

Axapta allow me to use .Net code (for instance ProcessInfo) to run external process / application.

But i think the problem is to run a local application via RDP. Is it possible ? Thanks

Upvotes: 1

Views: 8762

Answers (2)

Allon Guralnek
Allon Guralnek

Reputation: 16121

I generally agree with Damien, but I wanted to raise one more possible "hackish" way of doing out-of-band communication between a local client connected via Remote Desktop (RD) to a remote host, and that is the clipboard. One feature of RD is that it synchronizes the clipboard between the remote and local host, thereby allowing the user to copy-paste across computer boundaries.

The fact that you can programmatically set the clipboard content on the server, and that you could set up a clipboard listener on the client (to be notified when the clipboard changes), would allow you to perform simple communication over RD. I've successfully used this technique whereby a telnet client would put something into the clipboard and my C# application would listen to that and launch an application when a certain magic string was put in the clipboard.

Setting the clipboard can be done natively in .NET and becoming a clipboard listener can also be done via .NET, by P/Invoke-ing SetClipboardViewer and a few other Win32 APIs.

Upvotes: 2

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239646

There's no simple way I'm aware of nor any managed way either.

The API you'd be interested in would be Remote Desktop Service Virtual Channels:

A virtual channel application has two parts, a client module and a server module. The server module is an executable program running on the Remote Desktop Session Host (RD Session Host) server. The client module is a DLL that must be loaded into memory on the client computer when the Remote Desktop Connection (RDC) client program runs.

You would then use standard inter-process signalling to communicate with the server module, to forward the "launch" command to the client module, which would then finally run the "local" application.

To be honest, I wouldn't have thought it worth it.

Upvotes: 2

Related Questions