Jak ustawić inne okno, które jest uruchomione, aby było zawsze na wierzchu (StayOnTop)?
np. jak zrobić aby już uruchomiony Notepad stał się oknem o atrybucie StayOnTop.--Looknijcie na main Page - głópawa troche ale obleci ;-})
SetWindowPos(FindWindow(nil,'Untitled - Notepad'),HWND_TOPMOST,
0,0,0,0,SWP_NOMOVE or SWP_NOSIZE);
(zakladajac, ze w notepadzie nic nie jest otwarte, czyli jest Untitled)--Pawel
Delphi6
A oto wersja uniwersalniejsza. Troche zawila, moze ktos wynajdzie prostsza...
var
WinHandle :THandle;
TitleBar : string;
Size : Integer;
begin
WinHandle:=GetForegroundWindow();
repeat
WinHandle:=GetWindow(WinHandle, GW_HWNDNEXT);
if WinHandle=0 then Exit;
Size:=GetWindowTextLength(WinHandle);
SetLength(TitleBar,Succ(Size));
GetWindowText(WinHandle,PChar(TitleBar),Succ(Size));
until Pos('Notepad',TitleBar)<>0;
SetWindowPos(WinHandle,HWND_TOPMOST,
0,0,0,0,SWP_NOMOVE or SWP_NOSIZE);
end;--Pawel
Delphi6
dzieki--Looknijcie na main Page - głópawa troche ale obleci ;-})