On Sat, Aug 28, 2021 at 03:32:59PM +0200, Piotr Caban wrote:
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;
I tried the code you suggested, but it fails the tests. I'll do a bit more investigation, I'm not sure why it isn't working...
Thanks, Piotr