Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

Automated Login for Remote Desktop Mobile II

, 4 May 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Tool to have Remote Desktop Mobile login automatically to a terminal server

Some days ago I published my RDP_Autologin code: RDP_Autologin

As there were some screen metrics hardcoded and more and more devices come with a VGA screen the hardcoded QVGA values will not match. So I extended the first version and implemented some additional logic and settings.

First, the emulated screen tap has been adjusted to depend on the device screen width and height. For that I included the HIRES_AWARE resource to get the real screen size.

	DWORD dX = (0xFFFF / iScreenWidth) * (80); // changed from 13 to width=240, 1/3=80
	DWORD dY = (0xFFFF / iScreenHeight) * (iScreenHeight - 13);
BOOL getScreenSize(){
	int iScreenX = GetSystemMetrics(SM_CXSCREEN);
	int iScreenY = GetSystemMetrics(SM_CYSCREEN);
	DEBUGMSG(1, (L"\ngetScreenSize: x=%i, y=%i\n", iScreenX, iScreenY));
	if(iScreenX+iScreenY > 0){
		_itow(iScreenWidth, sScreenWidth, 10);
		_itow(iScreenHeight, sScreenHeight, 10);
		return TRUE;
		return FALSE;

The rdp file defaults for desktop width and height will also be calculated but you can set the default to use via the registry.


"Save Password"="1"

As you can see, I added a line where you can specify an application that will be started at the end of the autoconnect process: startOnExit.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author


Germany Germany
No Biography provided

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150414.1 | Last Updated 4 May 2010
Article Copyright 2010 by hjgode
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid