Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for CAPS LOCK = ON
Is it possible to check wether the user of a Worksheet has CAPS LOCK set to
on or off |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for CAPS LOCK = ON
Got it!!!
in Module: Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 ' Maintenance string for PSS usage End Type ' API declarations: Private Declare Function GetVersionEx Lib "Kernel32" _ Alias "GetVersionExA" _ (lpVersionInformation As OSVERSIONINFO) As Long Private Declare Sub keybd_event Lib "user32" _ (ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwflags As Long, ByVal dwExtraInfo As Long) Private Declare Function GetKeyboardState Lib "user32" _ (pbKeyState As Byte) As Long ' Constant declarations: Const VK_CAPITAL = &H14 Function IsCapsLockOn() As Boolean Dim o As OSVERSIONINFO o.dwOSVersionInfoSize = Len(o) GetVersionEx o Dim keys(0 To 255) As Byte GetKeyboardState keys(0) IsCapsLockOn = keys(VK_CAPITAL) End Function '******END****** "akyhne" skrev: Is it possible to check wether the user of a Worksheet has CAPS LOCK set to on or off |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for CAPS LOCK = ON
I think you only need this much of what you posted:
Private Declare Function GetKeyboardState Lib "user32" _ (pbKeyState As Byte) As Long ' Constant declarations: Const VK_CAPITAL = &H14 Function IsCapsLockOn() As Boolean Dim keys(0 To 255) As Byte GetKeyboardState keys(0) IsCapsLockOn = keys(VK_CAPITAL) End Function -- Regards, Tom Ogilvy "akyhne" wrote in message ... Got it!!! in Module: Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 ' Maintenance string for PSS usage End Type ' API declarations: Private Declare Function GetVersionEx Lib "Kernel32" _ Alias "GetVersionExA" _ (lpVersionInformation As OSVERSIONINFO) As Long Private Declare Sub keybd_event Lib "user32" _ (ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwflags As Long, ByVal dwExtraInfo As Long) Private Declare Function GetKeyboardState Lib "user32" _ (pbKeyState As Byte) As Long ' Constant declarations: Const VK_CAPITAL = &H14 Function IsCapsLockOn() As Boolean Dim o As OSVERSIONINFO o.dwOSVersionInfoSize = Len(o) GetVersionEx o Dim keys(0 To 255) As Byte GetKeyboardState keys(0) IsCapsLockOn = keys(VK_CAPITAL) End Function '******END****** "akyhne" skrev: Is it possible to check wether the user of a Worksheet has CAPS LOCK set to on or off |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to lock the Ctrl key? (as locking the Shift key w/Caps Lock) | Excel Discussion (Misc queries) | |||
Reverse Caps Lock | Excel Discussion (Misc queries) | |||
Force Caps Lock | Excel Programming | |||
Caps Lock | Excel Programming | |||
Caps lock | Excel Programming |