Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
2.40/5 (2 votes)
See more:
Hi,

I am currently working on a KVM Over IP application. When the mouse moves to the edge of the server's screen, the server begins to send mouse movements to the client using UDP ports (TCP was taking too long to keep the mouse movement smooth).

I am currently using Cursor.Position = new Point(X, Y) to update the clients mouse. I have noticed today that if a Windows 7 client is locked then the cursor position is not being updated. It works fine on a Windows XP machine.

Is there another way that I can move the mouse position that would also work during the lock screen?

Any help and advice would be appreciated.

Thanks,

Lee
Posted
Updated 16-Dec-13 1:32am
v2
Comments
BillWoodruff 16-Dec-13 9:21am    
You could try using the WinAPI:

http://stackoverflow.com/a/1392221

I have not tried this myself, and I am not sure it would work in the rather exotic KVM scenario you are working with.
IceUK 16-Dec-13 9:28am    
Thanks for your response but the link you have given is using Cursor.Position. What makes you say it is exotic?

I'm pretty sure that you are trying to duplicate almost exactly what Mouse Without Borders does (its a Microsoft download).

Download it, install it somewhere (or just extract the MSI). Its written in .NET and you can see how they performed everything (including drag/drop between computers) if you open the assemblies with ILSpy.
 
Share this answer
 
Comments
IceUK 16-Dec-13 11:31am    
Thanks, I will give that a go!
btarb24 10-Jun-22 13:49pm    
Ever find a solution to do it with your own code? I'm unable to use Mouse Without Borders due to firewall so I've written a kvm to work over a USB null modem cable. Works great except for the lock screen.
The reason it doesn't work is because you don't understand how things work in Windows. You need to understand what a Window Station is and it's relationship to a Desktop and user input (keyboard and mouse).

It doesn't work because the lock screen is in a different station, and hence, a completely different desktop from the user desktop that your application is running in.

Start reading: http://msdn.microsoft.com/en-us/library/windows/desktop/ms687096(v=vs.85).aspx
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Dec-13 15:29pm    
5!—SA
Approach this from this side: if client's screen is locked, you don't need a mouse location. That's the reason of not updating in in Windows 7: it would only waste CPU resources without any use. Just follow this decision and don't update mouse through the network. If it is not updated, it is not needed. It will be updated (perhaps in one jump) when the screen is unlocked.

—SA
 
Share this answer
 
Comments
IceUK 16-Dec-13 10:45am    
Thanks for your response. The purpose of the application is to control multiple PCs with one keyboard and mouse. I still need to be able to move the mouse on the client PC when it is locked so that a user on the host PC can unlock it.
Sergey Alexandrovich Kryukov 16-Dec-13 10:58am    
I think my advice is still applicable.
—SA
IceUK 16-Dec-13 11:00am    
The user needs to be able to move the mouse the the password box and remotely unlock the PC, your advise is not applicable but thanks anyway.
Sergey Alexandrovich Kryukov 16-Dec-13 11:02am    
Please tell me how that mouse position could be relevant? Use the mouse position on remote computer, where the user actually works.
—SA
IceUK 16-Dec-13 11:08am    
I think you have misunderstood the concept. The application is to allow a user to control two or more PCs with one keyboard and mouse connected to the host PC. This is a seamless application as apposed to using remote control sessions.

The user can scroll their mouse off the edge of the screen and onto the next one alongside it.

The host simply transmits the mouse movements to the client.

This is working well but if the client PC is locked then the cursor is no longer moving with Cursor.Position on Win 7.

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