[DllImport("coredll.dll", SetLastError=true)]
public static extern short GetKeyState(VK nVirtKey);
Declare Function GetKeyState Lib "coredll.dll" (ByVal nVirtKey As [VK]) As Short
Do you know one? Please contribute it!
This function is very similar to the user32 function of the same name
Please add some!
This sample VB.net code will check whether the NumLock is on or off.
Const VK_NUMLOCK As Integer = CInt(System.Windows.Forms.Keys.NumLock)
Dim keystate As Short = GetKeyState(VK_NUMLOCK)
If (keystate = 0) Then
MsgBox("NumLock is off")
Else
MsgBox("NumLock is on")
End If