0

How can I create a rectangle on the screen that is invisible to any sort of screen capture(printscreen or aplications) ?

By create a rectangle on screen I mean something like this:

#include <Windows.h>
#include <iostream>

void drawRect(){
HDC screenDC = ::GetDC(0);
::Rectangle(screenDC, 200, 200, 300, 300);
::ReleaseDC(0, screenDC);
}
int main(void){
char c;
std::cin >> c;
if (c == 'd') drawRect();
std::cin >> c;
return 0;
}

I'm using Visual Studio 2010 on Windows XP

Kesarion
  • 2,808
  • 5
  • 31
  • 52

2 Answers2

2

You cannot prevent this unless by means of hardware, as far as I know.

But.. what you could do (with a lot of effort) is to make it a lot harder.

Some tools have problems with tansparent windows, so you could put one of them on top of your window. You might experiment with custom-drawn parts.

What might make it really hard is to use DirectX output for that rectangle (though this is by no means an easy task - DirectX and WinForms, MFC or plain Win32 are not really compatible at all.

Still, you could have a look here Take screenshot of DirectX full-screen application for people describing their problems on capturing DirectX apps.

Community
  • 1
  • 1
Andreas Reiff
  • 7,961
  • 10
  • 50
  • 104
1

you can not. screen captures will capture the screen as presented.

Randy
  • 16,480
  • 1
  • 37
  • 55