Click here to Skip to main content
15,885,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir,

I am working on Desktop Sharing. I need a way to capture mouse pointer coordinates at server side and to duplicate similar mouse at client side, this mouse pointer should be independent of client side computer local mouse actions. I know some APIs to get screen coordinates of global mouse. Please give some ideas to get this done and also give links where I can find documentation regarding this.

Awaiting for your reply.... Thanks in advance....

Anand
Posted

If you want to capture the mouse activity outside the bounds of your own application, then you need to use a hook[^]. MSDN has an overview[^] of their usage.

That will tell you when a mouse action (like a click) is performed. To know when the mouse moves, but does not perform an action, you will probably need to poll the mouse location using something like GetMouseMovePoints[^].

-PaulH
 
Share this answer
 
Comments
Ananda_mr 12-Aug-11 0:02am    
Dear Paul Heil,

This will help me to do in capture side. How can I create a similar cursor at remote machine within a window with this information got at sender machine.

Anand
Paul Heil 12-Aug-11 9:36am    
SendInput will move the mouse cursor around the screen. http://msdn.microsoft.com/en-us/library/ms646310%28v=vs.85%29.aspx
You can use GetMouseMovePoints[^] to find mouse location
 
Share this answer
 
Comments
Ananda_mr 12-Aug-11 0:02am    
Dear vivek511,

This will help me to do in capture side. How can I create a similar cursor at remote machine within a window with this information got at sender machine.

Anand
[no name] 16-Aug-11 1:19am    
You can’t create duplicate pointer in other windows but you can use your current mouse pointer for remote control . and second thing is not clear by your side what type of information you want gather from client side because you know you have to use Java script code for controlling remote pc and java script not work on server side.
Dear Paul Heil and vivek511,

This will help me to do in capture side. How can I create a similar cursor at remote machine within a windows with this information got at sender machine.

Anand
 
Share this answer
 
You can use below function of C#
UINT WINAPI SendInput(
__in UINT nInputs,
__in LPINPUT pInputs,
__in int cbSize
);
 
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