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:
var
MyBitmap: TBitmap
ScreenDC: HDC;
begin
MyBitmap := TBitmap.Create;
ScreenDC := GetDC(0);
MyBitmap.LoadFromDevice(ScreenDC);
ReleaseDC(ScreenDC);
BitBlt(bm.Canvas.Handle,0,0,bm.Width,bm.Height,hdcSrc,0,0,SRCCOPY);
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?