CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1999
    Posts
    21

    How to use GetWindowRect API?

    Hi

    Can anyone tell me how to use GetWindowRect API?

    I know where to get the API using API Text Viewer. However, do I need to define rect using the following codes :-

    Type Rect
    Left as long
    Right as long
    Top as long
    Bottom as long
    end type

    How can I get the left, top, right and bottom dimensions of a form using this GetWindowRect API?
    Pls Pls enlighten....source code will be better!

    Thankyou!!

    Beginner with problems


  2. #2
    Guest

    Re: How to use GetWindowRect API?

    You have to use the hwnd of the window you want to get the RECT of
    ie.

    dim myrect as RECT
    dim x as long
    x=GetWindowRect(form1.hwnd,myrect)



    This will give you the Rectangle for form1
    you can then use
    myrect.top,myrect.bottom etc



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

Featured