OSDN Git Service

nvdaInProcUtils_winword_expandToLine: use sendMessageTimeout rather than sendMessage...
authorMichael Curran <mick@kulgan.net>
Wed, 6 Jul 2011 02:09:28 +0000 (12:09 +1000)
committerMichael Curran <mick@kulgan.net>
Wed, 6 Jul 2011 02:09:28 +0000 (12:09 +1000)
nvdaHelper/remote/winword.cpp

index 511b3b4..fef9173 100644 (file)
@@ -87,7 +87,8 @@ LRESULT CALLBACK winword_callWndProcHook(int code, WPARAM wParam, LPARAM lParam)
 \r
 error_status_t nvdaInProcUtils_winword_expandToLine(handle_t bindingHandle, const long windowHandle, const int offset, int* lineStart, int* lineEnd) {\r
        winword_expandToLine_args args={offset,3,4};\r
-       SendMessage((HWND)windowHandle,wm_winword_expandToLine,(WPARAM)&args,0);\r
+       DWORD_PTR wmRes=0;\r
+       SendMessageTimeout((HWND)windowHandle,wm_winword_expandToLine,(WPARAM)&args,0,SMTO_ABORTIFHUNG,2000,&wmRes);\r
        *lineStart=args.lineStart;\r
        *lineEnd=args.lineEnd;\r
        return RPC_S_OK;\r