|
-
Nov 4th, 2001, 07:33 AM
#1
Thread Starter
Addicted Member
num-lock
is there a registry entry or similar, that says windows to turn numlock on/off, when logging on????
i have a win2000 pro, and when i login as admin, numlock is on.... but when i login as another user, numlock is off... but it should be on.........
if there is no setting, how to activate numlock from code (vb...)??? then i'll write a autorun app....
thanx
-
Nov 4th, 2001, 07:40 AM
#2
Conquistador
-
Nov 4th, 2001, 07:42 AM
#3
Here is code you can use to turn it on or off
VB Code:
Private Declare Function GetKeyboardState& Lib "user32" (pbKeyState As Byte)
Private Declare Function SetKeyboardState& Lib "user32" (lppbKeyState As Byte)
Dim keystate(256) As Byte
Private Sub TurnOnNumlock()
Call GetKeyboardState(keystate(0))
keystate(vbKeyNumlock) = keystate(vbKeyNumlock) Or 1
Call SetKeyboardState(keystate(0))
End Sub
Private Sub TurnOffNumlock()
Call GetKeyboardState(keystate(0))
keystate(vbKeyNumlock) = keystate(vbKeyNumlock) And &HFFFE
Call SetKeyboardState(keystate(0))
End Sub
Private Sub Command1_Click()
Call TurnOnNumlock
End Sub
Private Sub Command2_Click()
Call TurnOffNumlock
End Sub
What I find curious, however, is the fact that you would need this. I don't believe I've ever encountered any machine, running any OS, that didn't have numlock set to on at boot time.
-
Nov 4th, 2001, 07:43 AM
#4
Conquistador
Beat ya by 2 minutes Hack
-
Nov 4th, 2001, 07:45 AM
#5
Yeah, I know. I don't type all that fast on Sunday mornings I guess.
-
Nov 4th, 2001, 07:48 AM
#6
Conquistador
Saturday night here
-
Nov 4th, 2001, 07:51 AM
#7
The registry entry HKEY_CURRENT_USER\Control Panel\Keyboard\InitialKeyboardIndicators can be used to set the initial state of the Num Lock key for the current user.
To modify the num lock state for all users use HKEY_USERS\.DEFAULT\Control Panel\Keyboard\InitialKeyboardIndicators.
The value for InitialKeyboardIndicators should be set to 2.
An other way to keep the state of the Num Lock key is to always log off using the Ctrl+Alt+Del security dialog box.
Best regards
-
Jan 10th, 2002, 01:01 PM
#8
Member
Actually...
In response to Hack's comment:
What I find curious, however, is the fact that you would need this. I don't believe I've ever encountered any machine, running any OS, that didn't have numlock set to on at boot time
What about laptops?
I have used several different models (in fact, I'm using one now), and every one that I used had Num Lock set to "off" because the number pad is integrated with the rest of the keys. For instance, on the laptop I'm using now, when you hold down the "Fn" key the "number pad" keys are set up as follows:
M = 0
. = .
? = /
J = 1
K = 2
L = 3
; = +
U = 4
I = 5
O = 6
P = -
7 = 7
8 = 8
9 = 9
0 = *
Never say never... they always find a way to make things incompatible.
-
Jan 10th, 2002, 01:06 PM
#9
You make a good point FrogBoy. I had not considered Laptops.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|