Code
Procedure.l sp_GetDefaultRect(hwnd, *rc.RECT)
GetWindowPlacement_(hwnd, @wp.WINDOWPLACEMENT)
*rc\left = wp\rcNormalPosition\left
*rc\top = wp\rcNormalPosition\top
*rc\right = wp\rcNormalPosition\right
*rc\bottom = wp\rcNormalPosition\bottom
ProcedureReturn *rc
EndProcedure
Procedure.l EnumWindowsProc(hwnd, lParam)
If hwnd
If IsWindowVisible_(hwnd)
st$ = Space(256)
GetWindowText_(hwnd, @st$, 256)
If st$
sp_GetDefaultRect(hwnd, @winRc.RECT)
flag.s=Str(GetWindowLong_(hwnd, #GWL_EXSTYLE))
AddGadgetItem(1, -1, st$ + Chr(10) + Str(winRc\left) + Chr(10) + Str(winRc\top) + Chr(10) + Str(winRc\right) + Chr(10) + Str(winRc\bottom) + Chr(10) + Str(winRc\right - winRc\left) + Chr(10) + Str(winRc\bottom - winRc\top)+ Chr(10) +flag)
EndIf
EndIf
result = #True
Else
result = #False
EndIf
ProcedureReturn result
EndProcedure
If OpenWindow(0, 10, 10, 800, 500, "Sparked Window Rect", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
TextGadget(0, 10, 10, 780, 30, "These values indicate the default normal (non-maximized) coordinates of each window.")
ListIconGadget(1, 10, 50, 780, 440, "Window", 400, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect)
AddGadgetColumn(1, 1, "Left", 50)
AddGadgetColumn(1, 2, "Top", 50)
AddGadgetColumn(1, 3, "Right", 50)
AddGadgetColumn(1, 4, "Bottom", 50)
AddGadgetColumn(1, 5, "Width", 50)
AddGadgetColumn(1, 6, "Height", 50)
AddGadgetColumn(1, 7, "Флаг", 50)
EnumWindows_(@EnumWindowsProc(), 0)
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf