Two demos attached. This one shows the positions, dimensions and captions of all top level windows.
include \masm32\MasmBasic\MasmBasic.inc
ct dd ? ; global string counter
Init
Dim caption$()
Dim topwinrect() As RECT
MyEnum PROTO :DWORD, :DWORD
invoke EnumWindows, MyEnum, 0
Print cfm$("#\tx\ty\tw\th\tcaption")
For_ each rcx in topwinrect()
Print Str$("\n%i\t", ForNextCounter), Str$(rcx.left), Tb$, Str$(rcx.top), Tb$, Str$(rcx.right), Tb$, Str$(rcx.bottom), Tb$, Left$(caption$(ForNextCounter), 40)
Next_
Exit
MyEnum proc uses esi hwnd, dummyarg
mov esi, Win$(hwnd)
.if Len(esi)
.if StringsDiffer(esi, "MSCTFIME UI") ; exclude some
.if StringsDiffer(esi, "Default IME") ; boring little windows
Let caption$(ct)=esi
invoke GetWindowRect, hwnd, VarPtr(topwinrect(ct)) ; store the dimensions
inc ct
.endif
.endif
.endif
or eax, -1 ; continue
ret
MyEnum endp
EndOfCode