Zitat von
hoika:
Hallo,
der Befehl heisst BringWindowToFront
als Link ein bisschen c++ Code,
ist gut lesbar, sollte 1:1 in Delphi umsetzbar sein.
1
Heiko
mal aus rein persönlichen Intresse währe das richtig übersetzt?
Delphi-Quellcode:
function ForceWindowToFront(HWND : hWnd):Boolean;
var
ForegroundWindowThreadID : Dword;
WindowThreadID : DWord;
Begin
if (hWnd = GetForegroundWindow) then
Result := true
else
Begin
ForegroundWindowThreadID := GetWindowThreadProcessId(GetForegroundWindow, nil);
WindowThreadID := GetWindowThreadProcessId(hWnd, nil);
if (ForegroundWindowThreadID <> WindowThreadID) then
Begin
AttachThreadInput(ForegroundWindowThreadID, WindowThreadID, true);
Result := SetForegroundWindow(hWnd);
AttachThreadInput(ForegroundWindowThreadID, WindowThreadID, false);
end
else
Result := SetForegroundWindow(hWnd);
ShowWindow(hWnd, SW_RESTORE);
end;
end;
Edit: Ok habs mal getestet also es tut was es soll