mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Win-specific: ScanPopup: Don't use unsupported word retrieving methods for GD own windows
This commit is contained in:
parent
e48b04b95c
commit
90dced09dd
|
@ -18,7 +18,7 @@ GetWordProc_t GetWordProc = NULL;
|
||||||
GDDataStruct gds;
|
GDDataStruct gds;
|
||||||
UINT uGdAskMessage;
|
UINT uGdAskMessage;
|
||||||
WCHAR Buffer[256];
|
WCHAR Buffer[256];
|
||||||
DWORD ourProcessID;
|
DWORD ourProcessID, gdProcessID, winProcessID;
|
||||||
|
|
||||||
static HWND GetWindowFromPoint(POINT pt)
|
static HWND GetWindowFromPoint(POINT pt)
|
||||||
{
|
{
|
||||||
|
@ -90,6 +90,10 @@ LRESULT lr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't use other methods for GD own windows
|
||||||
|
if( winProcessID == gdProcessID )
|
||||||
|
return;
|
||||||
|
|
||||||
if( ( flags & GD_FLAG_METHOD_STANDARD ) != 0 && GetWordProc != 0 ) {
|
if( ( flags & GD_FLAG_METHOD_STANDARD ) != 0 && GetWordProc != 0 ) {
|
||||||
GlobalData->CurMod.WND = GlobalData->LastWND;
|
GlobalData->CurMod.WND = GlobalData->LastWND;
|
||||||
GlobalData->CurMod.Pt = GlobalData->LastPt;
|
GlobalData->CurMod.Pt = GlobalData->LastPt;
|
||||||
|
@ -151,7 +155,7 @@ DWORD wso;
|
||||||
while( 1 ) {
|
while( 1 ) {
|
||||||
POINT curPt;
|
POINT curPt;
|
||||||
HWND targetWnd;
|
HWND targetWnd;
|
||||||
DWORD winProcessID = 0;
|
winProcessID = 0;
|
||||||
|
|
||||||
if( !GetCursorPos( &curPt ) )
|
if( !GetCursorPos( &curPt ) )
|
||||||
break;
|
break;
|
||||||
|
@ -316,6 +320,7 @@ BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
ourProcessID = GetCurrentProcessId();
|
ourProcessID = GetCurrentProcessId();
|
||||||
|
GetWindowThreadProcessId( GlobalData->ServerWND, &gdProcessID );
|
||||||
if(hSynhroMutex==0) {
|
if(hSynhroMutex==0) {
|
||||||
hSynhroMutex = CreateMutex(NULL, FALSE, "GoldenDictTextOutSpyMutex");
|
hSynhroMutex = CreateMutex(NULL, FALSE, "GoldenDictTextOutSpyMutex");
|
||||||
if(hSynhroMutex==0) {
|
if(hSynhroMutex==0) {
|
||||||
|
|
Loading…
Reference in a new issue