[V8i C++]How can I disable locate by Levels

Hello everyone!

I wanna develop a new tool to disable users from selecting elements belonging to a specified level.The final effect shows below.Whenever cursor hovers over those elements,it will show forbidden.It would be very helpful if you can show me some key code or whatever!