mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-18 03:14:06 +00:00
Add some checks into scan libraries
This commit is contained in:
parent
69e0e3806b
commit
a815716810
|
@ -42,6 +42,9 @@ LRESULT lr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !IsWindow( GlobalData->ServerWND ) )
|
||||||
|
return;
|
||||||
|
|
||||||
// Ask for needing to retrieve word - WPARAM = 1
|
// Ask for needing to retrieve word - WPARAM = 1
|
||||||
lr = SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 1, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
lr = SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 1, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
||||||
if( lr == 0 || SendMsgAnswer == 0) //No answer or no needing
|
if( lr == 0 || SendMsgAnswer == 0) //No answer or no needing
|
||||||
|
@ -67,6 +70,7 @@ LRESULT lr;
|
||||||
GlobalData->CurMod.WordLen = n;
|
GlobalData->CurMod.WordLen = n;
|
||||||
GlobalData->CurMod.BeginPos = 0;
|
GlobalData->CurMod.BeginPos = 0;
|
||||||
if(n > 0) {
|
if(n > 0) {
|
||||||
|
if( IsWindow( GlobalData->ServerWND ) )
|
||||||
SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -78,6 +82,7 @@ LRESULT lr;
|
||||||
GlobalData->CurMod.Pt = GlobalData->LastPt;
|
GlobalData->CurMod.Pt = GlobalData->LastPt;
|
||||||
GetWordProc(&(GlobalData->CurMod));
|
GetWordProc(&(GlobalData->CurMod));
|
||||||
if (GlobalData->CurMod.WordLen > 0) {
|
if (GlobalData->CurMod.WordLen > 0) {
|
||||||
|
if( IsWindow( GlobalData->ServerWND ) )
|
||||||
SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,12 +91,13 @@ LRESULT lr;
|
||||||
if( ( flags & GD_FLAG_METHOD_IACCESSIBLEEX ) != 0 ) {
|
if( ( flags & GD_FLAG_METHOD_IACCESSIBLEEX ) != 0 ) {
|
||||||
getWordByAccEx( GlobalData->LastPt );
|
getWordByAccEx( GlobalData->LastPt );
|
||||||
if (GlobalData->CurMod.WordLen > 0 ) {
|
if (GlobalData->CurMod.WordLen > 0 ) {
|
||||||
|
if( IsWindow( GlobalData->ServerWND ) )
|
||||||
SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
SendMessageTimeout(GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0, SMTO_ABORTIFHUNG, MOUSEOVER_INTERVAL, &SendMsgAnswer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( flags & GD_FLAG_METHOD_UI_AUTOMATION ) != 0 ) {
|
if( ( flags & GD_FLAG_METHOD_UI_AUTOMATION ) != 0 && IsWindow( GlobalData->ServerWND ) ) {
|
||||||
PostMessage( GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0 );
|
PostMessage( GlobalData->ServerWND, WM_MY_SHOW_TRANSLATION, 0, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue