473,396 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How detect NumLock condition?

Could someone tell me what code I run to determine if the user's numlock is
on?

Is there code I can run to set the numlock to on?

Nov 20 '05 #1
2 3187
Hi,

Const VK_NUMLOCK = &H90

Declare Function GetKeyState Lib "user32" Alias "GetKeyState" (ByVal
nVirtKey As Integer) As Short

If GetKeyState(VK_NUMLOCK) Then

Me.Text = "Num"

Else

Me.Text = ""

End If

Ken
----------------
"Woody Splawn" <wo***@splawns.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Could someone tell me what code I run to determine if the user's numlock is on?

Is there code I can run to set the numlock to on?

Nov 20 '05 #2
Hi Woody,

You may try to GetKeyState API to restrieve the state of Numlock and use
the keybd_event to set the state of NUM LOCK.

Here is a VB6 version.
HOWTO: Toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK Keys
http://support.microsoft.com/default...b;EN-US;177674

If you have any concern on this issue, please post here.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: George | last post by:
Every time I used the Sendkeys command in my application the "Numlock" turned off and I couldn't use the keypad to hit numbers...... The old code was: Private Sub Command1_Click() SendKeys...
5
by: James Kirkup | last post by:
Hello, Does anyone know in code how to turn the NumLock key on in C#? with regards James *** Sent via Developersdex http://www.developersdex.com ***
4
by: sanjana | last post by:
hi can anyone help me with this i want to write a code in c#.net which detects usb storage and media card insertion can anyone help me with this?? thanx
2
by: Chris | last post by:
can anyone out there tell me how do u check the state of these keys in vb.net? or is there any components in the .NET Framework that supports doing so? any help is appreciated. Thanks.
5
by: Stan Sainte-Rose | last post by:
Hi I saw a post about numlock but I can't not read it. I would like to check the state of the numlock key and if it's not active, set its status on active. How can I accomplish that in vb ? ...
1
by: nTn | last post by:
I'd like show in my status bar, status of NumLock, CapsLock and ScrollLock. How I do? Thx
1
by: charlies224 | last post by:
Hi, I am writting a software that requires me to make sure the Num Lock is always on and Caps Lock is always off. First, I know how to detect if Num Lock or Caps Lock is on or off (if...
10
by: lgbjr | last post by:
Hi All, In VB.Net how do I determine if CapsLock is on/off (same for NumLock) and whether the input mode is set to Insert or Overwrite (Insert Key). I just added a status bar to my app, and I...
0
by: =?Utf-8?B?Q29tcHV0ZXJfRW5naW5lZXJfU3R1ZGVudA==?= | last post by:
I'm locking for an C# equivalent to the VBS code On Error Resume Next Set objWord = CreateObject("Word.Application", "" & txtPCName.Value & "") strCapsLock = objWord.CapsLock strNumLock =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.