I
import
Unregistered / Unconfirmed
GUEST, unregistred user!
get the focus systemwide? function GetSysFocus: Integer;
var
hFgWin, FgThreadID, hFocusWin: Integer;
begin
hFgWin := GetForegroundWindow;
FgThreadID := GetWindowThreadProcessID(hFgWin, nil);
if AttachThreadInput(GetCurrentThreadID, FgThreadID, True) then
begin
hFocusWin := GetFocus;
Result := GetFocus;
AttachThreadInput(GetCurrentThreadID, FgThreadID, False);
end
else
Result := GetFocus;
end;
var
hFgWin, FgThreadID, hFocusWin: Integer;
begin
hFgWin := GetForegroundWindow;
FgThreadID := GetWindowThreadProcessID(hFgWin, nil);
if AttachThreadInput(GetCurrentThreadID, FgThreadID, True) then
begin
hFocusWin := GetFocus;
Result := GetFocus;
AttachThreadInput(GetCurrentThreadID, FgThreadID, False);
end
else
Result := GetFocus;
end;