Joe Strazzere - All Things Quality

Visit my new blog at http://strazzere.blogspot.com/


December 1, 2005 - WinTask - GetWindowRect

Posted in WinTask

'
' GetWindowRect - get the bounding rectangle of a window
'
' "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As RECT) As Long
'

'Dim leftpoint as unsigned
'Dim toppoint as unsigned
'Dim rightpoint as unsigned
'Dim bottompoint as unsigned
Dim memptr as unsigned
Dim memptr1 as unsigned
Dim memptr2 as unsigned
Dim memptr3 as unsigned
Dim memptr4 as unsigned

memptr=allocate(16)

hwnd=GetWindowHandle(focus$(),1)

ret = External("user32","GetWindowRect", hwnd, memptr)

memptr1=memptr+0
leftpoint   =peekinteger(memptr1,4)
memptr2=memptr+4
toppoint    =peekinteger(memptr2,4)
memptr3=memptr+8
rightpoint  =peekinteger(memptr3,4)
memptr4=memptr+12
bottompoint =peekinteger(memptr4,4)

msgbox(Str$(leftpoint)+" "+Str$(toppoint)+" "+Str$(rightpoint)+" "+Str$(bottompoint),,"GetWindowRect")


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now