Я правильно это делаю?
[DllImport("user32", CharSet = CharSet.Auto)]
internal static extern long SystemParametersInfo(long uAction, int lpvParam, ref bool uParam, int fuWinIni);
...
public static bool IsScreenReaderRunning()
{
long SPI_GETSCREENREADER = 70L;
bool bScreenReader = false;
long retVal;
retVal = SystemParametersInfo(SPI_GETSCREENREADER, 0, ref bScreenReader, 0);
//uint iParam = 0;
//uint iUpdate = 0;
//bool result = false;
//bool bReturn = SystemParametersInfo(SPI_GETSCREENREADER, iParam, &bScreenReader, iUpdate);
return bScreenReader;
}
public static void ScreenReaderOn()
{
long SPI_GETSCREENREADER = 71L;
bool bScreenReader = true;
long retVal;
retVal = SystemParametersInfo(SPI_GETSCREENREADER, 0, ref bScreenReader, 0);
}
public static void ScreenReaderOff()
{
long SPI_GETSCREENREADER = 71L;
bool bScreenReader = false;
long retVal;
retVal = SystemParametersInfo(SPI_GETSCREENREADER, 0, ref bScreenReader, 0);
}