본문 바로가기
Delphi Tip/+Tip

키보드 키입력 막기 - 화면 캡처 방지(Blocking Screen Capture)

by MonoSoft 2024. 5. 29.
728x90
반응형

키보드 키입력 막기 - 화면 캡처 방지(Blocking Screen Capture)

 

728x90

 

 

 

 

unit Unit1;

 

interface

 

uses

Winapi.Windows, Winapi.Messages, System.SysUtils,

System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms,

Vcl.Dialogs, Vcl.StdCtrls, ClipBrd;

 

type

TForm1 = class(TForm)

Button1: TButton;

procedure FormCreate(Sender: TObject);

private

{ Private declarations }

procedure ApplicationIdle(Sender: TObject; var Done: Boolean);

public

{ Public declarations }

end;

 

var

Form1: TForm1; implementation

 

{$R *.dfm}

 

{ TForm1 }

 

procedure TForm1.ApplicationIdle(Sender: TObject; var Done: Boolean);

begin

// Get rid of anything on clipboard

if GetAsyncKeyState(VK_SNAPSHOT) <> 0 then

ClipBoard.Clear;

Done := True;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

Application.OnIdle := ApplicationIdle;

end;

 

end.

 

728x90
반응형

댓글