CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Taking control of Remote Desktop

Hybrid View

  1. #1
    Join Date
    Mar 2019

    Taking control of Remote Desktop

    I'm trying to write an application that will allow my users to click on a button and have Remote Desktop automatically launch and login properly. Remote Desktop is only one of the many applications that I want to be able to do this with and for the other applications, I found the Window that I wanted, and called User32.FindWindowEx in the JNA library to get textfields and buttons to fill in and click. Remote Desktop though is different, it has a "button" that I need to click on in order to get the correct fields to show up, but the button itself doesn't seem to have a HWND.

    I've tried just clicking on the parent window at (120, 120) but that didn't work either.

    Does anyone have any advice on how to do this?

    Name:  hwnd.jpg
Views: 144
Size:  35.1 KB

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004

    Re: Taking control of Remote Desktop

    Probably a better way is to create and RDP file with the password in it and then use mstsc.exe to invoke it. The remote window will then open without Username and password prompt.

  3. #3
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012

    Re: Taking control of Remote Desktop

    Note the password is stored encrypted using something like cryptRDP5 and that an RDP file needs to be digitally signed using rdpsign.

    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.6.4)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)