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) BOOL diablo_find_window(LPCSTR lpClassName)
{ {
HWND result; // eax HWND hWnd, active;
HWND v2; // esi
HWND v3; // eax hWnd = FindWindow(lpClassName, 0);
HWND v4; // edi if (!hWnd)
return FALSE;
result = FindWindow(lpClassName, 0);
v2 = result; active = GetLastActivePopup(hWnd);
if (!result) if (active)
return 0; hWnd = active;
v3 = GetLastActivePopup(result); active = GetTopWindow(hWnd);
if (v3) if (!active)
v2 = v3; active = hWnd;
v4 = GetTopWindow(v2);
if (!v4) SetForegroundWindow(hWnd);
v4 = v2; SetFocus(active);
SetForegroundWindow(v2);
SetFocus(v4); return TRUE;
return 1;
} }
void diablo_reload_process(HINSTANCE hInstance) void diablo_reload_process(HINSTANCE hInstance)

Loading…
Cancel
Save