The remote Desktop is proprietary software by Microsoft, and you would need to rely on what they offer to you if you want to use that software. You can start here;
Remote Desktop Protocol - Win32 apps | Microsoft Docs[
^]
There are some open-source alternate resources and protocols that you can look into and use instead of building something from fresh. Something like FreeRDP would help you in this:
FreeRDP[
^], I have used this protocol on Linux environment as well.
Taking a screenshot, sharing control is a secondary part. You start with understanding whether a protocol fully supports your requirement or not.