Results 1 to 3 of 3

Thread: Is there a way to get the active window's coordinates?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    norcross, ga, USA
    Posts
    82

    Is there a way to get the active window's coordinates?

    I would like to retreive the x and y coordinates of the active window.

    Thanks in advanced.

    C

  2. #2
    Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    36
    If you can get the hWnd of the active Window, you could use the GetWindowRect API.

    VB Code:
    1. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    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. dim Rec as RECT
    11.  
    12. GetWindowRect Activehwnd, Rec

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    norcross, ga, USA
    Posts
    82
    Perfect! Thanks a lot for the help.

    C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width