Recent

Author Topic: Detecting Screen capture calls and interfering them ?  (Read 4233 times)

piksi

  • Newbie
  • Posts: 1
    • http://pi-xi.net/
Detecting Screen capture calls and interfering them ?
« on: July 07, 2007, 02:39:01 am »
Hi,

I'm a long time Pascal programmer, used FPC for the last 5 years or so and lately I've got interested in Lazarus RAD development. Out of curiosity for learning new stuff, I decided to make a Windows program which could monitor for suspicious calls, such as capturing the desktop or parts of it and either prevent the action, or (even cooler), replace the captured bitmap with for example a "gotcha!" -bitmap.

I've learned a few ways to capture the screen myself:
Code: [Select]
var
  MyBitmap: TBitmap
  ScreenDC: HDC;
begin
  MyBitmap := TBitmap.Create;
  ScreenDC := GetDC(0);
  MyBitmap.LoadFromDevice(ScreenDC);
  ReleaseDC(ScreenDC);


Code: [Select]

BitBlt(bm.Canvas.Handle,0,0,bm.Width,bm.Height,hdcSrc,0,0,SRCCOPY);


Code: [Select]
c := TCanvas.Create;
c.Handle := GetWindowDC(GetDesktopWindow);
h := GetDesktopWindow;
if h <> 0 then
   GetWindowRect(h, SourceRect);
bm.Canvas.CopyRect(DestRect, c, SourceRect);


I was wondering if there is any kind of way to monitor the desktop and program windows for such calls and interfere them?

 

TinyPortal © 2005-2018