I get accessdenied(5) error in following console app codes, is there anyway to protect console window against screenshot?
int wmain(void)
{
HWND hWnd = GetConsoleWindow();
BOOL b = SetWindowDisplayAffinity(hWnd, WDA_MONITOR);
DWORD e = GetLastError(); // e==5
return 0;
}