Sver
Full Member
Posts: 145
|
Post by Sver on Nov 17, 2023 3:06:05 GMT -5
nomainwin
'loadbmp "pic", "boy.bmp" 'hPic = hBmp("pic")
WindowWidth = 400 WindowHeight = 400
UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2)
statictext #RoundWindow.txt1, "Hei !", 146, 110, 200, 120 statictext #RoundWindow.txt2, "Liberty Basic", 108, 148, 110, 25 ' stylebits #RoundWindow.st1, _SS_BITMAP or _SS_CENTERIMAGE, 0, 0, 0 button #RoundWindow.trap, "Exit", [closeRoundWindow], UL, 130, 255, 60, 30 open "Round" for window as #RoundWindow #RoundWindow "trapclose [closeRoundWindow]" #RoundWindow "font New_Courier 12 Bold"
'Obtain the Handles and Device Controls hRw = hWnd(#RoundWindow) ' hSt = hWnd(#RoundWindow.st1)
'Define the circle hRgn = EllipticRegion(40, 80, 300, 330) call SetWindowRgn hRw, hRgn
'Set the image ' call setImage hSt, hPic wait
[closeRoundWindow] ' unloadbmp "pic"
close #RoundWindow end
function RectRegion(ulx, uly, width, height)
calldll #gdi32, "CreateRectRgn", _ ulx as long, _ uly as long, _ width as long, _ height as long, _ RectRegion as ulong end function
function EllipticRegion(ulx, uly, width, height) calldll #gdi32, "CreateEllipticRgn", _ ulx as long, _ uly as long, _ width as long, _ height as long, _ EllipticRegion as ulong end function
sub SetWindowRgn hWnd, hRgn calldll #user32, "SetWindowRgn",_ hWnd as ulong,_ hRgn as ulong,_ 1 as boolean,_ returnSWR as long end sub
sub setImage hStatic, hImage calldll #user32, "SendMessageA",_ hStatic as ulong, _ _STM_SETIMAGE as long, _ _IMAGE_BITMAP as long, _ hImage as ulong, _ result as long end sub
|
|
|
Post by tsh73 on Nov 17, 2023 3:29:05 GMT -5
This is a way to go to make non-rectangular app. (HEAVILY non-rectangular!!) Like these skins, for example www.muses.org/community-skinsWith CreatePolygonRgn of cource.
|
|