Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default StickyKeys Status

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   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default StickyKeys Status

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default StickyKeys Status

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   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default StickyKeys Status

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   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default StickyKeys Status

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
reuest formula for auto update status & status date PERANISH Excel Worksheet Functions 5 June 2nd 08 04:26 PM
Status bar msg is gone Kent McPherson Setting up and Configuration of Excel 5 February 9th 07 09:32 PM
Status Bar Vikesh Jain Excel Programming 3 June 27th 06 06:31 PM
Need a msg box that displays time status or loading status havocdragon Excel Programming 2 April 2nd 05 05:29 PM
STATUS BAR Fernando Duran Excel Programming 2 February 20th 04 10:00 PM


All times are GMT +1. The time now is 09:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"