also, Bit 19 ist #WS_SYSMENU.
und das #WS_DLGFRAME ist gesetzt, weil es zusammen mit #WS_BORDER das doppelflag #WS_CAPTION bildet.
.... vielleicht erinnert sich ein alter Hase bei Microsoft, warum Kopfleiste aus Rahmen und Dialograhmen zusammengesetzt wird.
Bit31 ist #PB_Window_Borderless, das ist #WS_POPUP
und die beiden, die in beiden zuständen gesetzt sind, sind #WS_CLIPSIBLINGS und #WS_VISIBLE
Code: Alles auswählen
#Window = 0
OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 300, 220, "", #PB_Window_BorderLess)
NoBorder = GetWindowLongPtr_(WindowID(#Window), #GWL_STYLE)
NoBorder1 = #WS_CLIPSIBLINGS | #WS_VISIBLE | #WS_POPUP
OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 300, 220, "", #PB_Window_SystemMenu)
Border = GetWindowLongPtr_(WindowID(#Window), #GWL_STYLE)
Border1 = #WS_CLIPSIBLINGS | #WS_VISIBLE | #WS_CAPTION | #WS_SYSMENU
Debug RSet( Bin( NoBorder , #PB_Long ), 32, "0" ) + " NoBorder"
Debug RSet( Bin( NoBorder1 , #PB_Long ), 32, "0" ) + " NoBorder1"
Debug RSet( Bin( Border , #PB_Long ), 32, "0" ) + " Border"
Debug RSet( Bin( Border1 , #PB_Long ), 32, "0" ) + " Border1"
Debug " "
Debug RSet( Bin( #WS_POPUP , #PB_Long ), 32, "0" ) + " #WS_POPUP"
Debug RSet( Bin( #WS_VISIBLE , #PB_Long ), 32, "0" ) + " #WS_VISIBLE"
Debug RSet( Bin( #WS_CLIPSIBLINGS , #PB_Long ), 32, "0" ) + " #WS_CLIPSIBLINGS"
Debug RSet( Bin( #WS_CAPTION , #PB_Long ), 32, "0" ) + " #WS_CAPTION"
Debug RSet( Bin( #WS_SYSMENU , #PB_Long ), 32, "0" ) + " #WS_SYSMENU"
also, der code sollte auch sauber laufen, wenn man diese Flags direkt setzt, ohne vorher Fenster zum testen öffnen zu müssen.
Code: Alles auswählen
EnableExplicit
Define.i WWE
Procedure WindowBorder(Window, Flag)
SetWindowLongPtr_(WindowID(Window), #GWL_STYLE, Flag)
SetWindowPos_(WindowID(Window), 0,0,0,0,0,#SWP_NOSIZE|#SWP_NOMOVE|#SWP_NOZORDER|#SWP_FRAMECHANGED)
EndProcedure
#Window=0
#Button_Border=0
#Button_NoBorder=1
#NoBorder = #WS_CLIPSIBLINGS | #WS_VISIBLE | #WS_POPUP
#Border = #WS_CLIPSIBLINGS | #WS_VISIBLE | #WS_CAPTION | #WS_SYSMENU
OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 300, 220, "")
ButtonGadget(#Button_Border, 5, 5, 290, 100, "Border")
ButtonGadget(#Button_NoBorder, 5, 110, 290, 100, "No Border")
Repeat
WWE=WaitWindowEvent()
Select WWE
Case #PB_Event_Gadget
Select EventGadget()
Case #Button_Border
WindowBorder(#Window, #Border)
Case #Button_NoBorder
WindowBorder(#Window, #NoBorder)
EndSelect
EndSelect
Until WWE = #PB_Event_CloseWindow