Running those functions before switching to fullscreen did the trick, I'm now getting the correct values. Should have seen that. Thanks!
I've tried to avoid using the Windows API but I'll have a look at it.
EDIT: For the resolution of the secondary monitor, one seems to have to go a bit of a detour:
var monitor2size_x = sys_metrics(78) - sys_metrics(0);
var monitor2size_y = sys_metrics(79);
Of course, this only works if the secondary monitor is larger in the Y direction than the primary monitor. If it is not, then the resolution will be incorrect in the Y direction.
I will investigate further to see if I can find a workaround to this.