Groups | Blog | Home
all groups > dotnet clr > august 2003 >

dotnet clr : Getting mouse and keyboard information in a Service


David Stevenson
8/27/2003 8:38:36 AM
I'm writing a service that tracks how much of the time you use the mouse vs
the keyboard. I've found that under Windows XP professional, I can get the
cursor position using GetCursorPos, but I am as of yet unable to get
information about the keyboard (I'm currently trying GetAsyncKeyState).

Under windows XP home edition, even GetCursorPos does not return the correct
position of the cursor. Both of these functions work correctly when I write
an application instead of a service.

I don't need the actual location of the cursor or the actual keys pressed on
the keyboard. Does anyone know how service permissions work, and/or what
functions I might be to use instead? Thanks!

-David Stevenson
stevend@mapleton.net

Phil Wilson
8/27/2003 3:37:21 PM
It might help to ask win32.programmer.kernel. Services are in a separate window
station with its own hidden desktop, and you need to bypass enough security to
see what the current interactives users are doing, and you'll need to
differentiate between different users in the Terminal Service/Fast User Switchng
environment.
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

AddThis Social Bookmark Button