PC Review


Reply
Thread Tools Rate Thread

How do I determine Num Lock status?

 
 
CK
Guest
Posts: n/a
 
      31st Aug 2003
How do I determine the Num Lock status, on or off, and
display it on a status bar?

TIA
 
Reply With Quote
 
 
 
 
Ken Tucker
Guest
Posts: n/a
 
      31st Aug 2003
Hi,

Use the getkeystate api to determine the numlock state. Setup a
timer to update the numlock panel on the statusbar.

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

Const VK_NUMLOCK = &H90

Ken

-----------

"CK" <(E-Mail Removed)> wrote in message
news:01e201c36ffd$0dd90000$(E-Mail Removed)...
> How do I determine the Num Lock status, on or off, and
> display it on a status bar?
>
> TIA



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      1st Sep 2003
Hello,

"CK" <(E-Mail Removed)> schrieb:
> How do I determine the Num Lock status, on or off, and
> display it on a status bar?


Untested:

\\\
Private Declare Auto Function GetKeyState Lib "user32.dll" ( _
ByVal nVirtKey As VirtualKey _
) As Boolean

Public Enum VirtualKey As Integer
NumLock = 144
CapLock = 20
End Enum
..
..
..
If GetKeyState(VirtualKey.NumLock) Then
...
End If
///

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet


 
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
How to determine the multi-session status of a CD in XP jim Windows XP General 2 7th Sep 2008 11:35 PM
VBA Code To Determine Read Only Status =?Utf-8?B?RS5RLg==?= Microsoft Access VBA Modules 4 14th Apr 2007 01:11 PM
Determine disabled status James Microsoft VB .NET 2 16th Feb 2006 10:33 AM
How to determine Fax Job Status Tore Bostrup Microsoft Windows 2000 Fax 5 27th Jun 2005 11:09 AM
How can I determine the status of the default printer Raymond Martin Microsoft VB .NET 3 1st Sep 2003 12:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:59 AM.