Main Menu

GetWindowRect

Started by Adaz, October 22, 2008, 08:29:34 AM

Previous topic - Next topic

Adaz

Hi kevin,

What did I wrong? PB crashes if I run this:

PlayBASIC Code: [Select]
type RECT
Left
Right
Top
Bottom
endtype

dim lpRect as RECT

LinkDll "user32.dll"
GetWindowRect (hwnd, lprect1) alias "GetWindowRect" As integer
EndLinkDll


err=GetWindowRect(getscreenhandle(), lpRect)

print lpRect.Left
print lpRect.Right
print lpRect.Top
print lpRect.Bottom

sync
waitkey



Ádáz

Hungary

kevin

#1
PlayBASIC Code: [Select]
type RECT
Left
Right
Top
Bottom
endtype

dim lpRect as RECT pointer
lprect = new rect

LinkDll "user32.dll"
GetWindowRect (hwnd, lprect1) alias "GetWindowRect" As integer
EndLinkDll


err=GetWindowRect(getscreenhandle(), Int(lpRect))

if err

print lpRect.Left
print lpRect.Right
print lpRect.Top
print lpRect.Bottom
endif

sync
waitkey



Adaz


Ádáz

Hungary