As Grey Alien posted, if you wanna keep it simple, the code below works great too.
?win32 Extern "win32" Function GetDeviceCaps%(hdc, nIndex) End Extern ? Global desktop_width:Int = GetDeviceCaps(GetDC(0),HORZREZ) Global desktop_height:Int = GetDeviceCaps(GetDC(0),VERTREZ) Global desktop_bpp:Int = GetDeviceCaps(GetDC(0),BITSPIXEL) Global desktop_hertz:Int = GetDeviceCaps(GetDC(0),VREFRESH)