Change window style from bordered to borderless and back?
Posted: Wed Mar 22, 2006 12:04 pm
Is it possible to change the style of a window from bordered to borderless and back while the program is running?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
; 2006 Hroudtwolf
; PB 4.00
If OpenWindow(0, 0, 0, 200, 200, "Remove windowstyle", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #WS_BORDER) And CreateGadgetList(WindowID(0))
ButtonGadget(0, 10, 10, 180, 20, "No Border")
ButtonGadget(1, 10, 40, 180, 20, "Border")
Repeat
Event.l=WaitWindowEvent()
If Event.l=#PB_Event_Gadget
HideWindow (0,1)
If EventGadget()=0
SetWindowLong_(WindowID(0),#GWL_STYLE,GetWindowLong_(WindowID(0),#GWL_STYLE)& ~#WS_BORDER)
ElseIf EventGadget()=1
SetWindowLong_(WindowID(0),#GWL_STYLE,GetWindowLong_(WindowID(0),#GWL_STYLE)|#WS_BORDER)
EndIf
HideWindow (0,0)
EndIf
Until Event = #PB_Event_CloseWindow
EndIf