How to get current screen size/resolution?

You should not use this code, prefer the one below, because it handle pointers protection. This solution may result in crashes