Click here to Skip to main content
16,021,823 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
[RESOLVED]

Hello,

I'm making a remote desktop program and in order to control the remote screen with my mouse i need to be able to send over the correct coordinates taking into consideration the size of my form.
In more detail, I will be moving my cursor over my form and my mouse position will be sent to the client so their mouse can move. If my form has the size (300,300) and the client's screen size is (1281,761), if i move my mouse to 300,300 on the form then their mouse should move to 1281,761, and if i move the mouse to 150,150 then the client's should move to ~640,380.

Does anyone have a code for this please? (I can't work out the math behind it). To test this on my own computer i'm settings label1.location to wherever the client mouse should go.

Please help!
Posted
Updated 21-Nov-13 5:57am
v2
Comments
Sergey Alexandrovich Kryukov 17-Nov-13 14:21pm    
Not clear. I believe you can only implement RDP if you control the remote system with the screen of identical size (which you can simulate by using a part of bigger screen on the client part) or at least the same aspect ratio. But then this is a simple linear transform of coordinates. How can it be a problem?
—SA
[no name] 17-Nov-13 14:58pm    
i don't understand how you can put your mouse in the top left of the form and the client's mouse goes to the top left of the screen.
Sergey Alexandrovich Kryukov 17-Nov-13 15:08pm    
Client is the part which controls the remote computer, and remote computer is server.
Now, when you move your mouse on the left, your server host mouse is not moved directly, it moves through the RDP protocol, so you can do the transform on the fly...
—SA
[no name] 17-Nov-13 15:16pm    
i'm making my own RDP, not using other people's, and i'm also using VB.net
Sergey Alexandrovich Kryukov 17-Nov-13 17:34pm    
Of course! I perfectly understand and fully respect that. But the problem you are trying to ask about looks so trivial that I though it might be useful to see how and RDP client is implemented by people who did not have to ask anyone about how to implement it... :-)
—SA

1 solution

Please see my comments to the question. It's not really clear which part could be your problem. You can take a look at two CodeProject works where this problem is apparently solved:

Remote Desktop using C#.NET[^],
Palantir - Remote Desktop Manager[^].

I especially like the second one, Palantir, and exactly because of the problem related to the one you are concerned with. Some time ago, I prepared the presentation and faced the problem of different screen sizes on two computers. I found that Microsoft Windows RDP client failed to solve the problem nicely, but, to my surprise, Palantir coped with it. So, please check it out.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900