CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2019
    Posts
    2

    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: 1853
Size:  35.1 KB

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

    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 offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    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.

    See https://superuser.com/questions/1396.../140322#140322
    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 https://creativecommons.org/publicdomain/zero/1.0/ 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++23 Compiler: Microsoft VS2022 (17.6.5)

  4. #4
    Join Date
    Mar 2021
    Posts
    3

    Re: Taking control of Remote Desktop

    If you will finish this application, share it with us please, it will be very useful.

  5. #5
    Join Date
    Mar 2021
    Posts
    3

    Re: Taking control of Remote Desktop

    I am looking forward to support you, if you need some help with it.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured