I did not make this, the community did. I just searched the forum and put it all together. Thanks to GreenGiant for helping me on the minimizing.
Code: Select all
#Win=0
#Button1=3
#Button2=4
Procedure SetFlat(gadgetnr)
#BS_FLAT=$8000
SetWindowLong_(GadgetID(gadgetnr),#GWL_STYLE,GetWindowLong_(GadgetID(gadgetnr),#GWL_STYLE) |#BS_FLAT)
EndProcedure
wnd = OpenWindow(#Win,0,0,400,300,"Borderless",#PB_Window_ScreenCentered | #PB_Window_BorderLess)
CreateImage(1, 398,28)
StartDrawing(ImageOutput(1))
Box(0,0,398,28, RGB(0,0,255))
BackColor(RGB(0,0,255))
FrontColor(RGB(255,255,255))
DrawText(10, 6,"Borderless")
StopDrawing()
ImageGadget(2, 1,1,398,28, ImageID(1))
DisableGadget(2,1)
ButtonGadget(#Button1,340,5,20,20,"_")
ButtonGadget(#Button2,370,5,20,20,"X")
FrameGadget(5, 0, 0, 400, 300, "", #PB_Frame_Flat)
SetFlat(3)
SetFlat(4)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget
GadgetID = EventGadget()
Select GadgetID
Case #Button1
ShowWindow_(WindowID(#Win),#SW_MINIMIZE)
Case #Button2
End
EndSelect
EndIf
If Event = #WM_LBUTTONDOWN
SendMessage_(wnd,#WM_NCLBUTTONDOWN, #HTCAPTION,0)
EndIf
Until Event = #PB_Event_CloseWindow
End