Programmatically Detecting Screen Readers
I was installing the RC of Visual Studio 2010 yesterday and while the setup program ran I noticed the words CHECKED and UNCHECKED appearing in the Tree View.
I was thinking I'd found some cool bug, like I was peering into some background world where checkboxes announce their state with text or something. I dunno, it was late, don't judge! ;)
I asked a few people and someone said to to see if I was running a Screen Reader. Screen Readers are what the visually impaired use to find their way around interfaces. It's no at bug at all, it's helping me.
I ran a little program based on this chunk of code found here. I started using the structures found at PInvoke.NET but they were overkill. I didn't need six pages of constants.
static extern bool SystemParametersInfo(int iAction, int iParam, out bool bActive, int iUpdate);
public static bool IsScreenReaderActive()
int iAction = 70; // SPI_GETSCREENREADER constant;
int iParam = 0;
int iUpdate = 0;
bool bActive = false;
bool bReturn = SystemParametersInfo(iAction, iParam, out bActive, iUpdate);
return bReturn && bActive;
static void Main(string args)
bool retVal = IsScreenReaderActive();
Scandalously, the result was true. What? I am running a screen reader? Um, no.
Well, actually, yes. I give lots of presentations, sometimes just to one person looking over my shoulder so I run the Windows 7 Magnifier via the WinKey and PLUS hotkey. When the Windows Magnifier is running, I'm running a Screen Reader in that I'm running an accessibility assistant.
Interesting stuff. I like it when applications are paying attention and helping with accessibility.
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
While regulations differ geographically, a program that does not meet the ADA [Americans with Disabilities Act] may not be purchased or required in environments that utilize certain government funding.
I've asked quite a few people about this (in vain), if they can tell me the shortcut or the command for the: "Undo close Windows Explorer".
It's possible to close the window of a Windows Explorer at some path, and then "UNDO THE CLOSE" i.e. an explorer window opens up at the same location. The only way to access this functionality is though using the 'Speech Recognition' system. I was unaware of the command, until I got to 'train' the system ... had to check out if the voice commands actually work under Win7... they don't.
But there you go... I was unable to replicate this command without the 'voice command'. So... a feedback on this would be most welcome.
But never the less, I get a hit on the server side for each and every request.
My other data service is based on a Linq-to-sql and I can see that it reaches the database everytime, even with those caching settings when the request starts.
However, it would be interesting how we can define SqlCachdeDependency and the server to get returning 304-not modified results!
Any advices/examples are welcome!
Comments are closed.
I spent a few hours yesterday with my secondary monitor turned off and NVDA running. If anything got too hard for me to navigate (bad website, or just me as the screen reader novice) I could always drag the flick the window back onto my primary monitor with Win+Left Arrow.