Browse Source

Clean up diablo_find_window

pull/256/head
Anders Jenbo 7 years ago
parent
commit
1aa0b809e1
  1. 35
      Source/diablo.cpp

35
Source/diablo.cpp

@ -484,25 +484,24 @@ void diablo_init_screen()
BOOL diablo_find_window(LPCSTR lpClassName)
{
HWND result; // eax
HWND v2; // esi
HWND v3; // eax
HWND v4; // edi
result = FindWindow(lpClassName, 0);
v2 = result;
if (!result)
return 0;
HWND hWnd, active;
hWnd = FindWindow(lpClassName, 0);
if (!hWnd)
return FALSE;
active = GetLastActivePopup(hWnd);
if (active)
hWnd = active;
v3 = GetLastActivePopup(result);
if (v3)
v2 = v3;
v4 = GetTopWindow(v2);
if (!v4)
v4 = v2;
SetForegroundWindow(v2);
SetFocus(v4);
return 1;
active = GetTopWindow(hWnd);
if (!active)
active = hWnd;
SetForegroundWindow(hWnd);
SetFocus(active);
return TRUE;
}
void diablo_reload_process(HINSTANCE hInstance)

Loading…
Cancel
Save