'================
'WindowRegion.bas v1.1
'================
'Uses Windows API to create a non-standard looking window.
'Using this you could use an image as the entire window instead.
'Coded by Dav, JULY/2020
'I used API information found on this page....
'http://allapi.mentalis.org/apilist/apilist.php
DIM apixy
AS POINTAPI
'mouse x/y for the GetCursorPos function
'sets a created window region
'http://allapi.mentalis.org/apilist/SetWindowRgn.shtml
'get current mouse x/y position
'http://allapi.mentalis.org/apilist/GetCursorPos.shtml
'creates a rectangular region
'http://allapi.mentalis.org/apilist/CreateRectRgn.shtml
'creates an elliptical region
'http://allapi.mentalis.org/apilist/CreateEllipticRgn.shtml
'creates a rectangular region with rounded corners
'http://allapi.mentalis.org/apilist/CreateRoundRectRgn.shtml
controls& = BASIMAGE1& 'Make Minimize & Exit controls image
_ICON controls&
'might as well make it the program icon too...
'Create a rounded rectangular region...
rgn& = CreateRoundRectRgn(30, 30, 650, 650, 240, 240)
'you can try these also...
'rgn& = CreateEllipticRgn(30, 30, 650, 650)
'rgn& = CreateRectRgn(30, 30, 650, 650)
'Set the created region...
try& = SetWindowRgn(hwnd&, rgn&, 0)
'Returns zero if failed...
'Setup screen....
LINE (0, y
)-(680, y
), _RGB(c
, c
, 64), BF
c
= c
+ 1:
IF c
> 32 THEN c
= 0
'Draw a top highlighted bar
LINE (0, 0)-(680, 80), _RGB(64, 64, 196), BF
'draw minimize and exit image
'LOCATE 12, 12: PRINT mx, my; _MOUSEBUTTON(1); 'testing info
'get orig mouse x/y using api
tmp = GetCursorPos(apixy)
origx = apixy.x: origy = apixy.y
'poll mouse x/y
tmp = GetCursorPos(apixy)
mx = apixy.x: my = apixy.y
origx = mx: origy = my
'see if user clicked minimized area
'wait until button up to continue
'minimize program
'see if user clicked exit area
'This function creates the control image.
'It was made with my BASIMAGE.BAS program .
A$ = ""
A$ = A$ + "haIkH_oCCM5007_l#P28JF6a`HbL3iIKY?hEO#aOHKJ04W^9ciLDX::aXbn1"
A$ = A$ + "U]iFfD7?4#4T7jLZK4#A5:<L;Z0^T]Q#L6a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