Hi Connor,
The patch looks good for me.
On 8/12/21 9:07 PM, Connor McAdams wrote:
- info.cbSize = sizeof(info);
- if(GetGUIThreadInfo(GetWindowThreadProcessId(This->hwnd, NULL), &info) &&
info.hwndFocus == This->hwnd)
It doesn't really matter but you can just call GetGUIThreadInfo(0, &info) here. If This->hwnd thread is not foreground the hwnd comparison will always fail.
While you're fixing the function are you also planning to fix the STATE_SYSTEM_FOCUSABLE flag? It should probably look like this: if(GetForegroundWindow() == GetAncestor(This->hwnd, GA_ROOT)) V_I4(pvarState) |= STATE_SYSTEM_FOCUSABLE;
Thanks, Piotr