I'm using this answer to get an external process dimension (using Process.MainWindowHandle and GetWindowRect\DwmGetWindowAttribute functions Pinvoke).
But I need to get the dimension of the window excluding any other process\window that hiding part\all of this process, in other words, only the visible area of this MainWindowsHandle.
For example, how do I get only the red dashed area of Explorer.exe and VNC.exe in this screenshot?