I have the need to programmatically RDP to a virtual machine(XP SP3 / .NET3.5 / VS 2008), (credentials have been saved in .rdp file) and do UI automation testing. Because of our domain security, I need to programmatically answer 'ok' to the interactive logon. I am able to access other dialogue Windows and SendMessages to buttons, etc, after login, but I have not been able to get my SendMessage to work on this initial screen. I used spy++ to capture what actually gets sent when I press enter and I seem to be able to duplicate those messages as I view the response in the spy++ log as I run my program, but no matter what variant I use in the message nothing happens.
I would like to know if it is even possible to programmatically do this or does the OS prevent this kind of automation due to security issues?
The messages I see in spy++ when I hit the enter button( on that initial screen it seems any key will do) I see:
When I exercise the code below and watch the messages sent to IHWindowClass(hwnd6 below) I see I generate the above messages to that window. Any help would be appreciated!
Here are the pertinent sections of the code:
UIntPtr ip = new UIntPtr(0x0D); //ENTER
UIntPtr ip2 = new UIntPtr(0xFF); //00FF
UIntPtr kyDwnlParam = new UIntPtr(0x001);
UIntPtr kyUplParam = new UIntPtr(0xc0000001);
// used UISpy to get these class names...
string lpszParentClass = "TscShellContainerClass";
string lpszParentWindow = "test2 - test2 - Remote Desktop Connection";
string lpszClass2 = "TscShellAxHostClass";
string lpszClass3 = "ATL:2D33D580";
string lpszClass4 = "UIMainClass";
string lpszClass5 = "UIContainerClass";
string lpszClass6 = "IHWindowClass";
Bookmarks