0

How can I determine if a RECT area inside of my window is covered by other windows (occluded). I mean, if the user can see this RECT area or not?

I could not find the right answer to this question. In fact, I should define a function with a signature like this

 bool isWindowPartVisible(HWND handle, RECT rect)

Inside this function, I am allowed to use only the Windows API function.

  • What context are you trying to determine this (is it during a WM_PAINT message)? Why do you need to determine this? (There may be a better way to achieve that, or it may be unnecessary.) [Edit] the question to include additional details. (Even if you determine if a part is visible, the user can move, expand, or make other UI changes that changes what part of your window is visible.) – 1201ProgramAlarm Sep 02 '21 at 16:28

1 Answers1

0

One way is to use WindowFromPoint() for sufficient number of points in that rect and check if it's YOUR window.

Vlad Feinstein
  • 10,960
  • 1
  • 12
  • 27