PC Review


Reply
Thread Tools Rate Thread

How detect NumLock condition?

 
 
Woody Splawn
Guest
Posts: n/a
 
      9th Dec 2003
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?



 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      10th Dec 2003
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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?
>
>
>



 
Reply With Quote
 
Peter Huang
Guest
Posts: n/a
 
      10th Dec 2003
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on VBA : how to detect "idle" condition Daniel Microsoft Excel Programming 2 4th Nov 2007 06:34 PM
lookup with multiple condition, but one condition to satisfy is en =?Utf-8?B?RWRkeSBTdGFu?= Microsoft Excel Worksheet Functions 2 27th Oct 2007 02:06 PM
Macro Condition to detect a query with 0 records =?Utf-8?B?Um9iZXJ0X0xfUm9zcw==?= Microsoft Access Macros 2 29th Oct 2004 09:05 PM
Condition is true in one cell, give me same condition in another T. Harris Microsoft Excel Misc 1 28th May 2004 08:20 PM
Can sumif detect text strings or detect if a dollar sign $ is in a cell? MollyDavis Microsoft Excel Misc 4 17th Apr 2004 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:38 AM.