type
TTransForm = class(TForm)
procedure FormActivate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormActivate(Sender: TObject);
begin
with Self do
SetWindowPos(Handle, HWND_TOPMOST, // 폼을 최상위로...
Left, Top, Width, Height,
SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
end;
procedure TForm1.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
with Self do
SetWindowPos(Handle, HWND_NOTOPMOST, // 폼의 최상위 해제...
Left, Top, Width, Height,
0);
CanClose := True;
end;
// 폼에 stay on top 속성을 지정해 보세요
unit unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, Gauges, ExtCtrls, ComCtrls;
type
TTransForm = class(TForm)
procedure FormActivate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormActivate(Sender: TObject);
begin
with Self do
SetWindowPos(Handle, HWND_TOPMOST, // 폼을 최상위로...
Left, Top, Width, Height,
SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
end;
procedure TForm1.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
with Self do
SetWindowPos(Handle, HWND_NOTOPMOST, // 폼의 최상위 해제...
Left, Top, Width, Height,
0);
CanClose := True;
end;
end.