- Windows CE Programming - https://www.hjgode.de/wp -

Automated Login for Remote Desktop Mobile II

Update 18. nov 2011: fixed some bugs, as mentioned by Patrick S. (great to see, that some take and use the code):

Update 16. may 2011: converted code for VS2008(windows mobile 6 sdk), see Downloads at bottom

UPDATE 23 june 2010: new registry option to switch between MouseClick and Keyboard simulation:

"Save Password"="1"
"UseMouseClick"="0"    //added with version 3 to switch between mouse and keyboard simulation


Some days ago I published my RDP_Autologin code: RDP_Autologin [1]

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.


"startOnExit"="\Windows\rdp_keepbusy.exe" "DesktopHeight"=dword:000001E0 "DesktopWidth"=dword:00000280
"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.


evc4 source code: [Download not found]

Armv4i executable: [Download not found]

NEW: Version 3 adds new option to let the app use MouseClick or Keyboard Simulation

Update 18. nov 2011: [Download not found]

Exe File (ArmV4i) [Download not found]

eVC4 source code [Download not found]

NEW: VS2008 code and exe [Download not found]

Update 4.march 2011: Please also see http://blogs.msdn.com/b/raffael/archive/2009/09/11/remote-desktop-mobile-rdp-client-disconnects-after-10-minutes-of-inactivity.aspx about idle timeout