Home > database >  Is it possible to detect that someone is using my window's hwnd or dc
Is it possible to detect that someone is using my window's hwnd or dc

Time:09-26

I'm creating a native win32 gui application for generating, storing and displaying passwords. I want to detect if someone is trying to screenshot my window or if someone gets a handle to it's DC.

Is it possible to detect GetDC, BitBlt, GetPixel, billions of ways to get hwnd of my window and others methods to access my application's video memory?

CodePudding user response:

Preventing a user from having control over their machine is evil but I guess if you must... SetWindowDisplayAffinity

CodePudding user response:

Yes, if your programs doesn't work inside a VM or a remote session on another machine. But you should hook(by Detour for example https://github.com/microsoft/Detours) all WinAPI functions that can get the contents of a window or develop your own driver that will guard your application.

  • Related