Olavo Alexandrino

I wrote a Windows Service in C# that will log some user's activities such as website visited, internet time conection and "keyboard input".

the last one I don't know how to log. perhaps I will have to use some import for user32.dll

so, how could I do that

this feature log would be something so similar to a "Key logger" because will have some shorcuts based in the user key pressed

thanks!




Re: Visual C# General How to log the keyboard input in C#?

Asim Patnaik

Hi,

If I have correctly understood your requirement, then the following link may be of help:

http://www.codeproject.com/system/KeyHook.asp

Apologies in case I have got your requirement wrong.

Regards,

Asim.





Re: Visual C# General How to log the keyboard input in C#?

Olavo Alexandrino

yes.. that application does more than I need.

it shows where the event happens, which event happened, which key has pressed..so on

what I need would be just which key are being pressed by user

I'd like to get this information inside a Windows Servioce...

I already have it working fine...but now I have to add this requirement

the bad news: that is a C++ application.

thanks anyway!







Re: Visual C# General How to log the keyboard input in C#?

Chunsheng Tang - MSFT

Hi, Olavo

Since this is the Visual C# forum but your question is about C++, it is off-topic.

Hint:

You can use the GetAsyncKeyState API to get the status of a key.

Best Re






Re: Visual C# General How to log the keyboard input in C#?

Olavo Alexandrino

By Alexander Kent.

yest I've found this article...it has helping me understand how it works

thanks