Hi
I want to check and set the Caps Lock and Num Lock keys from within a program. In theory SendKeys will do this, but it doesnt seem to have any effect.
A thread last year dealt with this and the answer is below, but I cannot get this to work either
Dim iRetVal As Integer
' Check the status of the CAPS LOCK key
iRetVal = GetKeyState(VK_CAPITAL)
If iRetVal = 1 Then
' CAPS LOCK is already on - continue
Else
' CAPS LOCK is OFF - toggle key to ON
NTToggleKeyCaps
End If
Bascially it cannot find GetKeyState, but I can find no reference for this.
All the best
Keith
I want to check and set the Caps Lock and Num Lock keys from within a program. In theory SendKeys will do this, but it doesnt seem to have any effect.
A thread last year dealt with this and the answer is below, but I cannot get this to work either
Dim iRetVal As Integer
' Check the status of the CAPS LOCK key
iRetVal = GetKeyState(VK_CAPITAL)
If iRetVal = 1 Then
' CAPS LOCK is already on - continue
Else
' CAPS LOCK is OFF - toggle key to ON
NTToggleKeyCaps
End If
Bascially it cannot find GetKeyState, but I can find no reference for this.
All the best
Keith