Mobile Developement – RDP AutoLogin extended (version 4)
Hello
on the wish of the one or other user I extended the RDP AutoLogin code and we now reached level 4.
The new code simply has only one extension, it supports the color depth selection. Also the color depth and other settings are visible on the dialog of Remote Desktop Mobile, the settings itself are done via the Default.rdp file. But you are right, RDP_AutoLogin also controls some of the dialog items directly.
[codesyntax lang=”text”]
... Domain:s: ColorDepthID:i:3 ScreenStyle:i:0 DesktopWidth:i:640 DesktopHeight:i:480 UserName:s:rdesktop ... ServerName:s:192.168.128.5 SavePassword:i:1 ...
[/codesyntax]
The color depth setting supports two modes, 8 Bit with 256b colors (ColorDepthID:i:1) and 16 Bit with ~65000 colors (ColorDepthID:i:3).
[codesyntax lang=”reg”]
REGEDIT4 [HKEY_LOCAL_MACHINE\Software\RDP_autologin] "FitToScreen"="1" "FullScreen"="1" "Status"="connecting..." "Save Password"="1" "Domain"="" "Password"="Intermec+2004" "Username"="rdesktop" "Computer"="192.168.0.130" "DesktopWidth"=640 "DesktopHeight"=480 "startOnExit"="\\rdp_keepBusy.exe" "execargs"="noRDPstart" "UseMouseClick"="0" //added with version 3 to switch between mouse and keyboard simulation "ColorDepth"=1 //added with version 4 to enable switching between 8 and 16 Bit colors
[/codesyntax]
The code changes are small. Some code addition to read the value from the registry and some to write the rdp file:
[codesyntax lang=”cpp”]
void readReg(){ ... //ColorDepth new with version 4 if(RegReadDword(L"ColorDepth", &dwTemp) == 0) dwColorDepth=dwTemp; ... } void writeRDP(){ ... else if(wcsstr(rdpLines[c].line, L"ColorDepthID")!=NULL){ wsprintf(szTemp, rdpLines[c].line, dwColorDepth); //3=HighColor(16Bit) or 1=(8Bit) color } ... }
[/codesyntax]
Additionally I have added a new project to the solution to enable to set all the settings not only via the registry but using a GUI application. RDP_Autologin_Settings is born:
As you see, there is also a small file browser integrated. The default OpenFile dialog of Compact Framework does not allow you to browse all directories, but only “\My Documents”.
RDP AutoLogin Settings Editor (exe): [Download not found]
source (Visual Studio 2008 WM5 SDK project): [Download not found]
RDP_AutoLogin (exe): [Download not found]
source (Visual Studio 2008 WM5 SDK project): [Download not found]
RDP_KeepBusy (exe): [Download not found]
RDP_KeepBusy (vs2008 WM5 SDK project): [Download not found]
Have fun
Josef