This is a simple set of procedures to skin the window into an ellipse, rectangle, or round rectangle. It only needs to be called once (it does not need to be under repeat). It will only work under Windows Operating Systems.
Code: Select all
; SkinWindow with Regions
; by roachofdeath
; 11/01/05
Procedure Set(hwnd,b)
SetWindowRgn_(hwnd,b,1)
EndProcedure
Procedure rectangle(hwnd,x,y,w,h)
ok=CreateRectRgn_(x,y,w,h)
Set(hwnd,ok)
EndProcedure
ProcedureDLL elliptical(hwnd,x,y,w,h)
ok=CreateEllipticRgn_(x,y,w,h)
Set(hwnd,ok)
EndProcedure
ProcedureDLL roundrectangle(hwnd,x,y,w,h,ew,eh)
ok=CreateRoundRectRgn_(x,y,w,h,ew,eh)
Set(hwnd,ok)
EndProcedure
;---[EXAMPLE
OpenWindow(0,100,40,500,500,"Skin Window Example",0)
i = 0
Repeat
roundrectangle(WindowID(0),100,40,500,500,i,i)
i+2
Select WaitWindowEvent()
Case #PB_Event_CloseWindow: End
EndSelect
ForEver