Получить системный фокус приложения
Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch
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;
|