DrawMenuBar(hwndMain);\r
}\r
\r
+#ifdef NVDA\r
+\r
+# include "nvdaController.h"\r
+\r
+ void\r
+ SayNVDA(char *text, BOOL interrupt)\r
+ {\r
+ static wchar_t buf[8000];\r
+ if(interrupt) nvdaController_cancelSpeech();\r
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, text, -1, buf, 8000);\r
+ nvdaController_speakText(buf);\r
+ }\r
+\r
+\r
+# undef UNICODE\r
+\r
+#endif\r
+\r
BOOL\r
InitJAWS()\r
{ // to be called at beginning of WinMain, after InitApplication and InitInstance\r
- HINSTANCE hApi = LoadLibrary("jfwapi32.dll");\r
- if(!hApi) {\r
+#ifdef NVDA\r
+ RealSayString = (PSAYSTRING) &SayNVDA; // assume NVDA\r
+ if(nvdaController_testIfRunning()) { // no NVDA; try JAWS\r
+#else\r
+ {\r
+#endif\r
+ HINSTANCE hApi = LoadLibrary("jfwapi32.dll");\r
+ if(!hApi) { // no interface to JAWS either\r
DisplayInformation("Missing jfwapi32.dll");\r
return (FALSE);\r
+ }\r
+ RealSayString = (PSAYSTRING)GetProcAddress(hApi, "JFWSayString");\r
}\r
\r
- RealSayString = (PSAYSTRING)GetProcAddress(hApi, "JFWSayString");\r
if(!RealSayString) {\r
DisplayInformation("SayString returned a null pointer");\r
return (FALSE);\r