User32GetAsyncKeyState(Int32) Method
Determines whether a key is up or down at the time the function is called,
and whether the key was pressed after a previous call to GetAsyncKeyState(Int32).
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll")]
public static short GetAsyncKeyState(
int vKey
)
<DllImportAttribute("User32.dll">]
Public Shared Function GetAsyncKeyState (
vKey As Integer
) As Short
Dim vKey As Integer
Dim returnValue As Short
returnValue = User32.GetAsyncKeyState(vKey)
public:
[DllImportAttribute(L"User32.dll")]
static short GetAsyncKeyState(
int vKey
)
[<DllImportAttribute("User32.dll")>]
static member GetAsyncKeyState :
vKey : int -> int16
No code example is currently available or this language may not be supported.
- vKey Int32
-
The virtual-key code.
You can use left- and right-distinguishing constants to specify certain keys.
See Virtual-Key Codes:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx
Int16
If the function succeeds,
the return value specifies whether the key was pressed since the last call to
GetAsyncKeyState(Int32),
and whether the key is currently up or down.
If the most significant bit is set, the key is down, and if the least significant bit is set,
the key was pressed after the previous call to
GetAsyncKeyState(Int32).
However, you should not rely on this last behavior.
The return value is zero for the following cases:
The current desktop is not the active desktop.
The foreground thread belongs to another process and the desktop does not allow the hook or the journal record.