autoscreen icon indicating copy to clipboard operation
autoscreen copied to clipboard

Prevent capture of certain applications.

Open ComputerCarl opened this issue 3 years ago • 1 comments

Is there a way to block the capture of certain applications? I use a schedule to regularly take screenshots. and use OneNote for personal information such as passwords. When the screen is captured, I would like to obfuscate/remove any area that is occupied by OneNote.

I believe the WindowsGraphicsCapture API has ExcludeFromCapture ability and describes the feature.

We have added a new flag to the SetWindowDisplayAffinity function, which supports content protection by returning black in screen captures of these windows. Sometimes, applications want to simply exclude a window from capture and not return black because things like recording buttons are not always desirable in captured content. When the new flag, WDA_EXCLUDEFROMCAPTURE, is set, the window will be removed from capture entirely

ComputerCarl avatar Mar 31 '21 23:03 ComputerCarl

The only way to do this for now is by comparing the active window title with a negation regex so if the active window title contains a word that should be ignored then the screen capture will not occur. To do this go to the Setup module in Auto Screen Capture and, in the Active Window Title section, enable the "Capture only if the title contains ..." option, switch it to Regular Expression Match, and then use this regex to negate any text containing the word "OneNote" in the active window title: ^((?!OneNote).)*$

If you want to add another word to it just use the pipe character as the delimiter: ^((?!OneNote|Bing|Edge).)*$

That regex will not take a screenshot if the active window title contains the words OneNote, Bing, or Edge.

gavinkendall avatar Apr 13 '21 12:04 gavinkendall