Since a while I was looking for API to find the keyboard button status with repspect to desktop as a whole. But when I searched through Google I could find only a way to capture the keboard event whit current application in focus.
But at last I got the a way to capture the button status without any application in focus which will capture status in global.
API in C# is:
This API will provide the information staus of all the kayes on keboard
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern int GetKeyboardState(byte[] keystate);
and
this API will provide the information of apecific key.
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
internal static extern short GetKeyState(int virtualKeyCode);
For more help on this topic please visit : http://msdn.microsoft.com/en-us/library/ms646299%28VS.85%29.aspx
No comments:
Post a Comment