GetAsyncKeyState Reference in C#, VB.NET and VB6
Visual Basic 6 definition
Visual Basic 6 example source code
Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
Visual Basic .NET definition
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
public static extern short GetAsyncKeyState(int vKey)
GetAsyncKeyState determines whether a certain key is currently pressed and whether that key has been pressed since the last call to the function. This function fails if the thread calling it does not currently have the input focus.
If the function fails (if the current thread does not have the input focus), the function returns 0. If the &H8000 bit of the return value is set, the key has been pressed at least once since the last time the thread called GetAsyncKeyState. If the &H1 bit of the return value is set, the key is currently pressed down.
For further information on Windows API functions such as these, and how to use these API's in your
C# and VB.NET applications, please refer to the book 'Network programming in .NET' (Buy at Amazon UK)
(Buy at Amazon US)
Visual Basic .NET example source code
C# example source code
Provide a code example
Copyright 2017 Infinite Loop Ltd.