Category: Forms
Title: Determine whether a window is on the top
Date added: 15.03.2006
Hits: 1508
function IsWindowOnTop(hWindow: HWND): Boolean;
begin
Result := (GetWindowLong(hWindow, GWL_EXSTYLE) and WS_EX_TOPMOST) <> 0
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if isWindowOnTop(FindWindow('notepad', nil))
then
Label1.Caption := 'Window ist on the top'
else
Label1.Caption := 'Window ist not on the top';
end;