Quote Originally Posted by Slyke
...The part that i'm missing is how to get the active window's top, left, width and height ...
Would this work for you?
VB Code:
  1. Option Explicit
  2.  
  3. Private Type RECT
  4.     Left As Long
  5.     Top As Long
  6.     Right As Long
  7.     Bottom As Long
  8. End Type
  9.  
  10. Private Declare Function GetActiveWindow Lib "user32" () As Long
  11. Private Declare Function GetWindowRect Lib "user32" _
  12.     (ByVal hWnd As Long, lpRect As RECT) As Long
  13.  
  14. Private Sub Command1_Click()
  15.     Timer1.Enabled = Not Timer1.Enabled
  16. End Sub
  17.  
  18. Private Sub Form_Load()
  19.     Timer1.Interval = 1000
  20.     Timer1.Enabled = False
  21. End Sub
  22.  
  23. Private Sub Timer1_Timer()
  24. Dim lWnd As Long
  25. Dim rct As RECT
  26.  
  27.     lWnd = GetActiveWindow()
  28.     GetWindowRect lWnd, rct
  29.    
  30.     Debug.Print "Left   = " & rct.Left * Screen.TwipsPerPixelX
  31.     Debug.Print "Top    = " & rct.Top * Screen.TwipsPerPixelY
  32.     Debug.Print "Height = " & (rct.Bottom - rct.Top) * Screen.TwipsPerPixelX
  33.     Debug.Print "Width  = " & (rct.Right - rct.Left) * Screen.TwipsPerPixelY
  34.  
  35. End Sub