56 lines
1.1 KiB
Plaintext
56 lines
1.1 KiB
Plaintext
unit DFindWindow;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
|
|
|
|
const
|
|
FRAME_LINE = 6;
|
|
|
|
type
|
|
TDlgFindWindow = class(TForm)
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
procedure ShowFindRect(const aRect: TRect);
|
|
end;
|
|
|
|
var
|
|
DlgFindWindow: TDlgFindWindow;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure TDlgFindWindow.ShowFindRect(const aRect: TRect);
|
|
var
|
|
RectRgn1,
|
|
RectRgn2,
|
|
RectRgn3 : THandle;
|
|
Monitor: TMonitor;
|
|
begin
|
|
// TForm.DefaultMonitor 속성을 dmDesktop로 해야 다른 모니터에도 표시가 된다... 21_0721 14:41:23 sunk
|
|
|
|
|
|
Left := aRect.Left;
|
|
Top := aRect.Top;
|
|
Width := aRect.Right - aRect.Left;
|
|
Height := aRect.Bottom - aRect.Top;
|
|
|
|
RectRgn1 := CreateRectRgn(0, 0, Width, Height);
|
|
RectRgn2 := CreateRectRgn(0, 0, Width, Height);
|
|
RectRgn3 := CreateRectRgn(FRAME_LINE, FRAME_LINE, Width-FRAME_LINE, Height-FRAME_LINE);
|
|
CombineRgn(RectRgn1, RectRgn2, RectRgn3, RGN_XOR);
|
|
SetWindowRgn(Handle, RectRgn1, True);
|
|
DeleteObject(RectRgn1);
|
|
DeleteObject(RectRgn2);
|
|
DeleteObject(RectRgn3);
|
|
|
|
Show;
|
|
end;
|
|
|
|
end.
|