Very neat...very complicated....I have experimented with this off and on over the years and come up with the below. There are known repaint problems with the controltoroundedrectangle function. But otherwise it is the effect you are looking for.
#include <GUIConstantsEx.au3>
#include <WINAPI.au3>
#include <GDIPlus.au3>
commonbck
()
Func commonbck
()
$Gui = GUICreate("", 400,300,-1,-1)
$bckpic_prime= GUICtrlCreatePic("BkgPic.jpg",0,0,400,300)
GuiCtrlSetState(-1,$GUI_DISABLE)
$bckpic= GUICtrlCreatePic("",50,50,300, 150)
GuiCtrlSetState(-1,$GUI_DISABLE)
background
(-1)
$title=GUICtrlCreateLabel("Transparent background, only one GUI",75,55,260,120)
GUICtrlSetFont(-1,20,400,1,"Verdana")
GUICtrlSetColor(-1,"0x000022")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()
_ControlToRoundedRectangle
($bckpic,0,0,270, 120,24)
EndFunc
While 1
sleep(50)
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
func background
($control)
_GDIPlus_Startup ()
$hwd=GUICtrlGetHandle($control)
;$guiname=_WinAPI_GetParent($hwd)
$width=_WinAPI_GetClientWidth($hwd)
$height=_WinAPI_GetClientHeight($hwd)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hwd)
$hBitmap1 = _GDIPlus_BitmapCreateFromGraphics($width,$height, $hGraphic)
$hImage1=_GDIPlus_ImageGetGraphicsContext($hBitmap1)
_GDIPlus_GraphicsSetSmoothingMode($hGraphic, 4)
for $p = 0 to $width step 1
$hPen2=_GDIPlus_PenCreate(BitOR(0x32000000,0x000000),1)
_GDIPlus_GraphicsDrawLine($hImage1,$p,1,$p,$height,$hPen2)
_GDIPlus_PenDispose($hPen2)
Next
_GDIPlus_GraphicsSetSmoothingMode($hImage1, 2)
$hBMP1 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap1)
_WinAPI_DeleteObject(GUICtrlSendMsg($control, 0x0172, 0, $hBMP1))
_GDIPlus_GraphicsDispose($hImage1)
_WinAPI_DeleteObject($hBMP1)
_GDIPlus_BitmapDispose($hBitmap1)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown ()
EndFunc
Func _ControlToRoundedRectangle
($aControl,$X1,$Y1,$X2,$Y2,$X3)
Local $l
Local $handle = GUICtrlGetHandle($aControl)
$l = DllCall("gdi32.dll","int","CreateRoundRectRgn","int",$X1,"int",$Y1,"int",$X2,"int",$Y2,"int",$X3,"int",$X3)
DllCall("user32.dll","int","SetWindowRgn","hwnd",$handle,"int",$l[0],"int",True)
EndFunc
Func startbmp
($iWidth, $iHeight)
;Create a new bitmap, this way the original opened png is left unchanged
$hBitmap = _GDIPlus_GraphicsCreateFromHWND(WinGetHandle($GUI))
$hImage = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hBitmap)
_WinAPI_DeleteObject($hBitmap)
Return $hImage
EndFunc