Mar 01

Improving my Remote Desktop Experience

I’ve been traveling quite a bit lately and I’ve found it particularly convenient to simply remote into my machine at the office and do all my work through Terminal Services (or are we supposed to be calling it Remote Desktop Services now?). This allows me to access the virtual machines and the servers located at the office without major latency. If you’ve ever tried using VMware Server Console through a VPN connection, you know what I’m talking about.

I always listen to music when working. At work, that’s not a problem since I’ve got all my music stored on my work computer. However, when on the road all my music is stored on my laptop. This becomes a problem since my laptop’s music player cannot be accessed without first minimizing the fullscreen remote desktop window.

Actually, there are two problems here:

  1. There is no keyboard shortcut for minimizing a fullscreen remote desktop session. You have to use the mouse cursor and click on the minimize button on the “banner” at the top.
  2. The media keys (play, pause, stop, etc.) that are present on so many laptops today are forwarded to the remote computer rather than to the music player on the local computer.

These problems become a real nuisance after a while when working primarily in a fullscreen remote desktop window, and so I decided to investigate if these problems could be addressed.

Terminal Services allow you to register add-ons that are loaded by mstsc.exe when you connect to a remote desktop server. Through a mechanism called virtual channels, the server- and client-side of the remote desktop connection can communicate with each other.

This mechanism is perfect for addressing the problems I identified above. For instance, when a hotkey is pressed in a fullscreen remote desktop session, the server requests that the client minimizes the remote desktop window, and when a media key is pressed it’s forwarded to the client, which injects the key press on the client computer such that it’s routed to e.g. the local music player without requiring the user to minimize the remote desktop window.

The add-on consists of three components described below. The client- and server-side components must be explicitly registered with Terminal Services at the client and server computers, respectively. You must be running with Administrator privileges when registering them.

Server-side component:

This component is responsible for intercepting the user input and forwarding it to the client computer. It does so by registering several hotkeys.

To register this component with Terminal Services, run the following command from Start->Run:

<path to component>\RdpServerControl.exe install

To unregister this component with Terminal Services, run the following command from Start->Run:

<path to component>\RdpServerControl.exe uninstall

The server-side component must be launched every time a new remote desktop session is initiated. You can do this manually by simply running the executable when you’ve connected to the server, or by having it start automatically when a user logs on. The component exits automatically when the user disconnects from the Terminal Services session.

Client-side component:

This component is responsible for executing the commands requested by the server-side component.

To register this component with Terminal Services, run the following command from Start->Run:

regsvr32 <path to component>\RdpClientControl.dll

To unregister this component with Terminal Services, run the following command from Start->Run:

regsvr32 /u <path to component>\RdpClientControl.dll

Configuration component:

This is just a small tool for configuring the server-side component. For instance, you can specify the keyboard shortcut for minimizing the fullscreen remote desktop window. It’s not required for using the add-on, which uses the default settings described below.

This component must be run on the server.

The default configuration is as follows:

  • Alt+F1: Minimize fullscreen remote desktop window.
  • Media keys are being forwarded by default.

Download

If you’d like to try out the add-on for yourself, you can get it here: x86 or x64. It requires the Visual C++ 2008 SP1 redistributable: x86 or x64.

Disclaimer:

Please note that it’s a very simple tool that was created for a very specific purpose, and the feature set is thereafter. If you experience any problems, drop me a line and I’d be more than happy to help you get it to work.

4 comments total.

Doug — Dec 07 2009 / 8:14am

CTRL-ALT-BREAK has always worked to toggle the RDP client window.

And where is you privacy policy if you are going to ask for email addresses? So 1990s….

Soren Dreijer — Dec 24 2009 / 3:34pm

Doug,

Ctrl-Alt-Break does indeed work if you want to change the RDP session into windowed mode and then tab out of it. However, that still doesn’t solve the volume problem that the add-on above addresses as well.

I’ll have our privacy policy added shortly. Hopefully, that’ll make you feel a little more at ease. I’m glad some people actually read those…

Gareth — Jan 29 2010 / 10:46am

I use a similar setup when I work from home but instead of a Terminal Server I RDP into my own work PC (via a VPN). Having just got myself a media keyboard I found the same issue with my own music and was very interested on trying this but it does not work.

I have x86 Vista in the office (will be upgraded to x64 Windows 7 later in the year) and have x64 Windows 7 at home.

Any idea how to pass through the media keys back to the client using this setup?

Thanks,
Gareth

Soren Dreijer — Mar 14 2010 / 4:37pm

Hi Gareth,

Sorry for the slow reply, but for some reason I didn’t get an e-mail notification about your comment.

I originally developed this on a Vista box and tested with Vista to Vista and XP to Vista, as far as I remember. I did recently notice similar behavior when I upgraded to Windows 7 and I’ll look into the issue as soon as I get some free time.

Thanks for the heads-up!

Add a comment.

Name:
E-mail:
Website:
reCAPTCHA:
Comment: