Code: Alles auswählen
Procedure CallBack(hWnd, Msg, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
If Msg = #WM_MOVE Or Msg = #WM_SIZE
WW = WindowWidth(0)
WH = WindowHeight(0)
ResizeGadget(0, -1, -1, WW - 10, WH - 10)
SetGadgetItemText(0, 0, Str(WindowX(0)), 1)
SetGadgetItemText(0, 1, Str(WindowY(0)), 1)
SetGadgetItemText(0, 2, Str(WW), 1)
SetGadgetItemText(0, 3, Str(WH), 1)
MyRect.RECT
GetWindowRect_(WindowID(0), @MyRect)
SetGadgetItemText(0, 4, Str(MyRect\Left), 1)
SetGadgetItemText(0, 5, Str(MyRect\Top), 1)
SetGadgetItemText(0, 6, Str(MyRect\Right), 1)
SetGadgetItemText(0, 7, Str(MyRect\Bottom), 1)
SetGadgetItemText(0, 8, Str(MyRect\Right - MyRect\Left), 1)
SetGadgetItemText(0, 9, Str(MyRect\Bottom - MyRect\Top), 1)
MyPoint.POINT
ClientToScreen_(WindowID(0), @MyPoint)
SetGadgetItemText(0, 10, Str(MyPoint\X), 1)
SetGadgetItemText(0, 11, Str(MyPoint\Y), 1)
SetGadgetItemText(0, 12, Str(MyPoint\X - MyRect\Left), 1)
SetGadgetItemText(0, 13, Str(MyPoint\Y - MyRect\Top), 1)
MyPlacement.WINDOWPLACEMENT
GetWindowPlacement_(WindowID(0), @MyPlacement)
SetGadgetItemText(0, 14, Str(MyPlacement\length), 1)
SetGadgetItemText(0, 15, Str(MyPlacement\flags), 1)
SetGadgetItemText(0, 16, Str(MyPlacement\showCmd), 1)
SetGadgetItemText(0, 17, Str(MyPlacement\ptMinPosition\X) + " " + Str(MyPlacement\ptMinPosition\Y), 1)
SetGadgetItemText(0, 18, Str(MyPlacement\ptMaxPosition\X) + " " + Str(MyPlacement\ptMinPosition\Y), 1)
SetGadgetItemText(0, 19, Str(MyPlacement\rcNormalPosition\Left), 1)
SetGadgetItemText(0, 20, Str(MyPlacement\rcNormalPosition\Top), 1)
SetGadgetItemText(0, 21, Str(MyPlacement\rcNormalPosition\Right), 1)
SetGadgetItemText(0, 22, Str(MyPlacement\rcNormalPosition\Bottom), 1)
EndIf
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 350, 400, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
ListIconGadget(0, 5, 5, 0, 0, "Attributes", 140, #PB_ListIcon_GridLines)
AddGadgetColumn(0, 1, "Value", 51)
AddGadgetColumn(0, 2, "API", 150)
#Eol = Chr(10)
AddGadgetItem(0, -1, "WindowX()" + #Eol + #Eol + "Purebasic")
AddGadgetItem(0, -1, "WindowY()" + #Eol + #Eol + "Purebasic")
AddGadgetItem(0, -1, "WindowWidth()" + #Eol + #Eol + "Purebasic")
AddGadgetItem(0, -1, "WindowHeight()" + #Eol + #Eol + "Purebasic")
AddGadgetItem(0, -1, "Rect\Left" + #Eol + #Eol + "GetWindowRect_()")
AddGadgetItem(0, -1, "Rect\Top" + #Eol + #Eol + "GetWindowRect_()")
AddGadgetItem(0, -1, "Rect\Right" + #Eol + #Eol + "GetWindowRect_()")
AddGadgetItem(0, -1, "Rect\Bottom" + #Eol + #Eol + "GetWindowRect_()")
AddGadgetItem(0, -1, "Rect Width" + #Eol + #Eol + "GetWindowRect_()")
AddGadgetItem(0, -1, "Rect Height" + #Eol + #Eol + "GetWindowRect_()")
AddGadgetItem(0, -1, "Client X" + #Eol + #Eol + "ClientToScreen_()")
AddGadgetItem(0, -1, "Client Y" + #Eol + #Eol + "ClientToScreen_()")
AddGadgetItem(0, -1, "Border X" + #Eol + #Eol + "ClientToScreen_()")
AddGadgetItem(0, -1, "Title Height" + #Eol + #Eol + "ClientToScreen_()")
AddGadgetItem(0, -1, "length" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "flags" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "showCmd" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "ptMinPosition" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "ptMaxPosition" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "rcNormalPosition\Left" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "rcNormalPosition\Top" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "rcNormalPosition\Right" + #Eol + #Eol + "GetWindowPlacement_()")
AddGadgetItem(0, -1, "rcNormalPosition\Bottom" + #Eol + #Eol + "GetWindowPlacement_()")
SetWindowCallback(@CallBack())
CallBack(WindowID(0), #WM_SIZE, 0, 0)
Repeat : Until WaitWindowEvent() = #WM_CLOSE
EndIf