...den Fokus systemweit ermitteln?

Autor: Thomas Stutz

Kategorie: System

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;

 

printed from
www.swissdelphicenter.ch
developers knowledge base