HWND GetFocusGlobal()
{
HWND Wnd;
HWND Result = NULL;
DWORD TId, PId;
Result = GetFocus();
if (!Result)
{
Wnd = GetForegroundWindow();
if(Wnd)
{
TId = GetWindowThreadProcessId(Wnd, &PId);
if (AttachThreadInput(GetCurrentThreadId(), TId, TRUE))
{
Result = GetFocus();
AttachThreadInput(GetCurrentThreadId(), TId, FALSE);
}
}
}
return Result;
}
My problem return a different hwnd !
but when passing return value from GetFocusGlobal() to this function GetClassName() return true classname ..
True Hwnd is : 0x30450 and GetFocusGlobal() return this Hwnd: 0x3044e