Public Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Public Declare Function GetFocus Lib "user32" () As Long Public Declare Function BringWindowToTop Lib "user32" (ByVal hWnd As Long) As Long Public Declare Function GetDesktopWindow Lib "user32" () As Long Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long Public Declare Function GetWindowRect Lib "user32" ( _ ByVal hWnd As Long, lpRect As RECT) As Long Public Declare Function MoveWindow Lib "user32" _ (ByVal hWnd As Long, ByVal x As Long, ByVal Y As Long, _ ByVal nWidth As Long, ByVal nHeight As Long, _ ByVal bRepaint As Long) As Long Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, _ ByVal hdc As Long) As Long Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, _ ByVal nIndex As Long) As Long Public Const LOGPIXELSX = 88 Public Const LOGPIXELSY = 90 Public Sub GetScreenResolution(ByRef x As Long, ByRef Y As Long) Dim rtgl As RECT Dim dTopHwnd As Long Dim scrRes As String 'get the hwnd of the Desktop dTopHwnd = GetDesktopWindow 'get the dimension of the desktop (screen resolution) GetWindowRect dTopHwnd, rtgl 'The rtgl.Right and rtgl.Bottom values give you the resolution size x = rtgl.Right Y = rtgl.Bottom End Sub