If I am working in an application and I press a key from the keyboard, how can I grab that key (or string) including the name of the original application using C #?
You need to set up window bindings to call the callback function for any keyboard event. You can use SetWindowsHookEx to set window hooks.
Check out this MSDN blog post to learn more about it.
http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx
There is a good example of a keylogger at codeproject.com . Hope this helps.