Click to See Complete Forum and Search --> : How to use GetWindowRect API?


zenn0
February 7th, 2000, 09:56 AM
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

February 7th, 2000, 10:01 AM
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