#Include <APIConstants.au3>
#Include <GDIPlus.au3>
#Include <WinAPIEx.au3>
$hShadow = GUICreate('', 430 + 28, 200 + 28, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
$hForm = GUICreate('', 440, 210, -1, -1, $WS_POPUP, $WS_EX_CONTROLPARENT, $hShadow)
_GDIPlus_Startup()
_WinAPI_UpdateLayeredWindowEx($hShadow, -1, -1, _CreateDropShadow(430, 200, 14, 0x80000000), 255, 1)
_GDIPlus_Shutdown()
WM_MOVE($hForm, $WM_MOVE, 0, 0)
GUIRegisterMsg($WM_MOVE, 'WM_MOVE')
GUISetState(@SW_SHOW, $hShadow)
GUISetState(@SW_SHOW, $hForm)
Do
Until GUIGetMsg() = -3
Func _CreateDropShadow($iWidth, $iHeight, $iRadius, $iARGB = 0)
Local $hGraphic, $hBrush, $hImage, $hBitmap
Local $aPart[4][5] = _
[[$iRadius, 0, $iWidth, $iRadius, -90], _
[$iWidth + $iRadius, $iRadius, $iRadius, $iHeight, 0], _
[$iRadius, $iHeight + $iRadius, $iWidth, $iRadius, 90], _
[0, $iRadius, $iRadius, $iHeight, 180]]
$hImage = _GDIPlus_BitmapCreateFromScan0($iWidth + 2 * $iRadius, $iHeight + 2 * $iRadius)
If Not $hImage Then
Return 0
EndIf
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
_GDIPlus_GraphicsClear($hGraphic, 0)
$hBrush = _GDIPlus_BrushCreateSolid($iARGB)
_GDIPlus_GraphicsFillRect($hGraphic, $iRadius, $iRadius, $iWidth, $iHeight, $hBrush)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iRadius, $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), -180, -90)
_GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iWidth + $iRadius, $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), -90, 0)
_GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iWidth + $iRadius, $iHeight + $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), 0, 90)
_GDIPlus_GraphicsDrawRadialGradient($hGraphic, $iRadius, $iHeight + $iRadius, $iRadius, $iARGB, BitAND($iARGB, 0x00FFFFFF), 90, 180)
For $i = 0 To 3
$tRect = DllStructCreate($tagGDIPRECTF)
For $j = 0 To 4
DllStructSetData($tRect, $j + 1, $aPart[$i][$j])
Next
$hBrush = _GDIPlus_LineBrushCreateFromRectWithAngle($tRect, $iARGB, BitAND($iARGB, 0x00FFFFFF), $aPart[$i][4], 0, 3)
_GDIPlus_GraphicsFillRect($hGraphic, $aPart[$i][0], $aPart[$i][1], $aPart[$i][2], $aPart[$i][3], $hBrush)
_GDIPlus_BrushDispose($hBrush)
Next
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
Return $hBitmap
EndFunc ;==>_CreateDropShadow
Func _GDIPlus_GraphicsDrawRadialGradient($hGraphics, $iX, $iY, $iRadius, $iARGB1, $iARGB2, $iStartAngle = 0, $iEndAngle = 360, $iStep = 5)
If $iStep < 1 Then
$iStep = 1
EndIf
Local $Xi = $iX - $iRadius, $Yi = $iY - $iRadius, $Di = 2 * $iRadius
Local $hBrush, $hMatrix, $Smooth = _GDIPlus_GraphicsGetSmoothingMode($hGraphics)
Local $Start = True
_GDIPlus_GraphicsSetSmoothingMode($hGraphics, 0)
$hBrush = _GDIPlus_LineBrushCreate(0, 0, $iRadius, 0, $iARGB1, $iARGB2, 3)
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, $iX, $iY)
While $iStartAngle < $iEndAngle
If $iStartAngle + $iStep > $iEndAngle Then
$iStep = $iEndAngle - $iStartAngle
EndIf
If $Start Then
_GDIPlus_MatrixRotate($hMatrix, $iStartAngle + $iStep / 2)
$Start = False
Else
_GDIPlus_MatrixRotate($hMatrix, $iStep)
EndIf
_GDIPlus_LineBrushSetTransform($hBrush, $hMatrix)
_GDIPlus_GraphicsFillPie($hGraphics, $Xi, $Yi, $Di, $Di, $iStartAngle, $iStep, $hBrush)
$iStartAngle += $iStep
WEnd
_GDIPlus_GraphicsSetSmoothingMode($hGraphics, $Smooth)
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_BrushDispose($hBrush)
Return 1
EndFunc ;==>_GDIPlus_GraphicsDrawRadialGradient
Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
Switch $hWnd
Case $hForm
Local $Pos = WinGetPos($hForm)
If Not @Error Then
WinMove($hShadow, '', $Pos[0] - 8, $Pos[1] - 8)
EndIf
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_MOVE