Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a method or API that I can use in VBA to determine the StickyKeys
status? Where it is off or on? -- Gary''s Student - gsnu200729 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't work a lot w/API calls, but pieced this together from these sites:
http://math.msu.su/~vfnik/WinApi/s/s...etersinfo.html http://www.section508.gov/IRSCourse/mod02/printVB.html It appears to work, but you'll want to check it out for yourself: Option Explicit Public Const SPI_GETSTICKYKEYS = 58 Public Const SKF_STICKYKEYSON = &H1 Public Type STICKYKEYS cbSize As Long dwFlags As Long End Type Public Declare Function SystemParametersInfo Lib "user32.dll" _ Alias "SystemParametersInfoA" (ByVal uAction As Long, _ ByVal uiParam As Long, pvParam As Any, ByVal fWinIni As Long) _ As Long Sub test() Dim sk As STICKYKEYS ' holds settings for StickyKeys Dim retval As Long ' return value sk.cbSize = Len(sk) ' set the size of the structure ' Load the StickyKeys settings into the structure. retval = SystemParametersInfo(SPI_GETSTICKYKEYS, Len(sk), sk, 0) ' don't need to notify ' Assign StickyKeys setting as on or off. If (sk.dwFlags And SKF_STICKYKEYSON) = SKF_STICKYKEYSON Then MsgBox "Stickykeys is on" Else MsgBox "Stickykeys is off" End If End Sub "Gary''s Student" wrote: Is there a method or API that I can use in VBA to determine the StickyKeys status? Where it is off or on? -- Gary''s Student - gsnu200729 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks !!
Great job on the research as well ! -- Gary''s Student - gsnu200729 "JMB" wrote: I don't work a lot w/API calls, but pieced this together from these sites: http://math.msu.su/~vfnik/WinApi/s/s...etersinfo.html http://www.section508.gov/IRSCourse/mod02/printVB.html It appears to work, but you'll want to check it out for yourself: Option Explicit Public Const SPI_GETSTICKYKEYS = 58 Public Const SKF_STICKYKEYSON = &H1 Public Type STICKYKEYS cbSize As Long dwFlags As Long End Type Public Declare Function SystemParametersInfo Lib "user32.dll" _ Alias "SystemParametersInfoA" (ByVal uAction As Long, _ ByVal uiParam As Long, pvParam As Any, ByVal fWinIni As Long) _ As Long Sub test() Dim sk As STICKYKEYS ' holds settings for StickyKeys Dim retval As Long ' return value sk.cbSize = Len(sk) ' set the size of the structure ' Load the StickyKeys settings into the structure. retval = SystemParametersInfo(SPI_GETSTICKYKEYS, Len(sk), sk, 0) ' don't need to notify ' Assign StickyKeys setting as on or off. If (sk.dwFlags And SKF_STICKYKEYSON) = SKF_STICKYKEYSON Then MsgBox "Stickykeys is on" Else MsgBox "Stickykeys is off" End If End Sub "Gary''s Student" wrote: Is there a method or API that I can use in VBA to determine the StickyKeys status? Where it is off or on? -- Gary''s Student - gsnu200729 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you're most welcome!
"Gary''s Student" wrote: Thanks !! Great job on the research as well ! -- Gary''s Student - gsnu200729 "JMB" wrote: I don't work a lot w/API calls, but pieced this together from these sites: http://math.msu.su/~vfnik/WinApi/s/s...etersinfo.html http://www.section508.gov/IRSCourse/mod02/printVB.html It appears to work, but you'll want to check it out for yourself: Option Explicit Public Const SPI_GETSTICKYKEYS = 58 Public Const SKF_STICKYKEYSON = &H1 Public Type STICKYKEYS cbSize As Long dwFlags As Long End Type Public Declare Function SystemParametersInfo Lib "user32.dll" _ Alias "SystemParametersInfoA" (ByVal uAction As Long, _ ByVal uiParam As Long, pvParam As Any, ByVal fWinIni As Long) _ As Long Sub test() Dim sk As STICKYKEYS ' holds settings for StickyKeys Dim retval As Long ' return value sk.cbSize = Len(sk) ' set the size of the structure ' Load the StickyKeys settings into the structure. retval = SystemParametersInfo(SPI_GETSTICKYKEYS, Len(sk), sk, 0) ' don't need to notify ' Assign StickyKeys setting as on or off. If (sk.dwFlags And SKF_STICKYKEYSON) = SKF_STICKYKEYSON Then MsgBox "Stickykeys is on" Else MsgBox "Stickykeys is off" End If End Sub "Gary''s Student" wrote: Is there a method or API that I can use in VBA to determine the StickyKeys status? Where it is off or on? -- Gary''s Student - gsnu200729 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
although, for my part, it was all a copy/paste operation. but, as my
coworker used to say, "plagiarism cuts overhead." "Gary''s Student" wrote: Thanks !! Great job on the research as well ! -- Gary''s Student - gsnu200729 "JMB" wrote: I don't work a lot w/API calls, but pieced this together from these sites: http://math.msu.su/~vfnik/WinApi/s/s...etersinfo.html http://www.section508.gov/IRSCourse/mod02/printVB.html It appears to work, but you'll want to check it out for yourself: Option Explicit Public Const SPI_GETSTICKYKEYS = 58 Public Const SKF_STICKYKEYSON = &H1 Public Type STICKYKEYS cbSize As Long dwFlags As Long End Type Public Declare Function SystemParametersInfo Lib "user32.dll" _ Alias "SystemParametersInfoA" (ByVal uAction As Long, _ ByVal uiParam As Long, pvParam As Any, ByVal fWinIni As Long) _ As Long Sub test() Dim sk As STICKYKEYS ' holds settings for StickyKeys Dim retval As Long ' return value sk.cbSize = Len(sk) ' set the size of the structure ' Load the StickyKeys settings into the structure. retval = SystemParametersInfo(SPI_GETSTICKYKEYS, Len(sk), sk, 0) ' don't need to notify ' Assign StickyKeys setting as on or off. If (sk.dwFlags And SKF_STICKYKEYSON) = SKF_STICKYKEYSON Then MsgBox "Stickykeys is on" Else MsgBox "Stickykeys is off" End If End Sub "Gary''s Student" wrote: Is there a method or API that I can use in VBA to determine the StickyKeys status? Where it is off or on? -- Gary''s Student - gsnu200729 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
reuest formula for auto update status & status date | Excel Worksheet Functions | |||
Status bar msg is gone | Setting up and Configuration of Excel | |||
Status Bar | Excel Programming | |||
Need a msg box that displays time status or loading status | Excel Programming | |||
STATUS BAR | Excel Programming |