As far as I know, there are two ways you could like to achieve it:
- Not allow print screens when your application is the window with focus - it is fairly
easy: you need to modify your window procedure to catch WM_HOTKEY
and you cannot pass it back to the system:
case WM_HOTKEY:
/* your code */;
break; // no DefWndProc() call
- Not allow print screens at all, when your app is running. You will have to set up a hook, which will direct all of the messages, even those out of your window to your program. Accurate info can be found here: http://www.cubert.net/2008/05/sntt-disable-print-screen-key-win32-api.html
You can also let your user make print screens, but blank the window, when print screen is detected. To do that, in fragment:
case WM_HOTKEY:
/* here you blank your window */;
DefWndProc(); // send the message about print screen back to the system.
break;
Of course it all depends on the API you use, but assuming you use bare WinAPI - this is the way you do it.