Fenster, Region ausstanzen

def SetWindowRgn(3) !"USER32","SetWindowRgn"
def EllipticRgn(4) !"GDI32","CreateEllipticRgn"
def RoundRectRgn(6) !"GDI32","CreateRoundRectRgn"
def RectRgn(4) !"GDI32","CreateRectRgn"
CLS 0
Declare x&

WhileNot iskey(2)'rechte Maustaste

    x&=Not(x&)
    Case x&=1 :  CutRgnDLG(%hwnd,RectRgn(100, height(%hwnd)-70, width(%hwnd)-100, height(%hwnd)-30), RectRgn(100, 90, 180, 170), RectRgn(width(%hwnd)-180, 90, width(%hwnd)-100, 170))
    Case x&=0 :  FixDLG(%hwnd)
    Waitinput

EndWhile

CutRgnDLG(%hwnd,EllipticRgn(100, 100, width(%hwnd)-100, height(%hwnd)-100))
Waitinput

Proc CutRgnDLG

    Parameters hdl&
    Declare region&,wRgn&
    wRgn&=RectRgn(0,0,width(hdl&)+100,height(hdl&)+100)

    whileloop 2,%PCount

        region&=@&(&loop)
        External("GDI32","CombineRgn",wRgn&,region&,wrgn&,3)
        DeleteObject region&

    EndWhile

    SetWindowRgn(hdl&, wRgn&, 1)
    DeleteObject wRgn&

EndProc

Proc FixDLG

    Parameters hdl&
    Var wRgn&=RectRgn(0,0,width(hdl&)+100,height(hdl&)+100)
    SetWindowRgn(hdl&, wRgn&, 0)
    DeleteObject wRgn&

EndProc