Ciaran,
A service in this case is not the correct solution. A service is not
aware of the currently logged on session, as there could be no current
session, or multiple sessions.
What you want to do is have a program run when the user logs on, and
then have that insert a windows hook which will capture the keystrokes.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"cashdeskmac" <ca*********@discussions.microsoft.comwrote in message
news:20**********************************@microsof t.com...
Basically I am trying to create a crude keylogger application. I didn't
want
to show a form from the Windows service (using a Windows form was an
alternative option, and although it works, it is not the ideal way to
capture
all key strokes).
I would rather have the windows service running in the background from the
moment the computer starts to the moment is closes down.
I realise that there are free keyloggers available on the web but I would
like to add my own functionality.
"Ciaran O''Donnell" wrote:
>What is the effect you are trying to achieve. You cannot show a form from
a
service but you might not want a service, you might be interested in a
notfify icon
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"cashdeskmac" wrote:
I know how to capture a keypress for a windows application, but how
would I
go about doing it for a windows service?
Rather than having a form in focus all the time, I would prefer to have
something running in the background. There are option such as having
the
form invisible (opacity set to zero) and settings it's location
as -200, -200
so that it isn't on the screen, but this isn't the ideal solution.