How to check if you are in menu or in-game controls
In the client.dll you can see that a function in the GameUIFuncs interface is used to get the matching screen mode.
The interface's name is VENGINE_GAMEUIFUNCS_VERSION005 and its located in "engine.dll"
As you can see, the function is at the interface pointer + 56.
56 / 4 (size of a pointer) = 14 (index of the function).
I constructed a class for everyone that is 2 lazy to do that