An option to center a window in the client area
Posted: Sun Apr 13, 2008 12:51 pm
Centered screens don't take into account the taskbar, would be handy to have a #pb_window_clientCentered flag or similar.
I know this code isn't getting the actual size of the client area, but if it did then it would still center it in the middle of the screen and not offset it due to the position of the taskbar.
I know this code isn't getting the actual size of the client area, but if it did then it would still center it in the middle of the screen and not offset it due to the position of the taskbar.
Code: Select all
ExamineDesktops()
w=DesktopWidth(0)
h=DesktopHeight(0)-64; simulate taskbar height
OpenWindow(0, 0, 0, w, h, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver