For anyone else keeping tabs on this thread, I wouldn't want to leave you out.
#NoTrayIcon
#include <File.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
Dim $_GuiDelete
Local $sTestPath = _PathFull('splash.png')
If Not FileExists ('splash.png') Then FileInstall ('splash.png', $sTestPath)
Local $sSoundPath = _PathFull('splash.wav')
If Not FileExists ('splash.wav') Then FileInstall ('splash.wav', $sSoundPath)
$sPng = 'splash.png'
_GDIPlus_Startup ()
$hImage = _GDIPlus_ImageLoadFromFile ($sPng)
$_Gui = GUICreate ('gui', 768, 1366, 0, 0, -1, BitOR ($WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
For $iFadeIn = 1 To 255 Step 10
$hImage = _ImageResize ($sPng, 768, 1366)
_SetBitMap ($_Gui, $hImage, 768, 1366, $iFadeIn)
GUISetState (@SW_SHOW)
Next
$sSnd = 'splash.wav'
SoundPlay($sSnd, 1)
Sleep (500)
For $iFadeOut = 255 To 1 Step -10
$hImage = _ImageResize ($sPng, 768, 1366)
_SetBitMap ($_Gui, $hImage, 768, 1366, $iFadeOut)
GUISetState (@SW_SHOW)
Next
_GDIPlus_GraphicsDispose ($hImage)
_GDIPlus_Shutdown ()
While Not $_GuiDelete
$_GuiDelete = Not GUIDelete (WinGetHandle ('gui'))
WEnd
Exit
Func _SetBitmap ($hGUI, $hImage, $n_width, $n_height, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC (0)
$hMemDC = _WinAPI_CreateCompatibleDC ($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap ($hImage)
$hOld = _WinAPI_SelectObject ($hMemDC, $hBitmap)
$tSize = DllStructCreate ($tagSIZE)
$pSize = DllStructGetPtr ($tSize)
DllStructSetData ($tSize, 'X', $n_width)
DllStructSetData ($tSize, 'Y', $n_height)
$tSource = DllStructCreate ($tagPOINT)
$pSource = DllStructGetPtr ($tSource)
$tBlend = DllStructCreate ($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr ($tBlend)
DllStructSetData ($tBlend, 'Alpha', $iOpacity)
DllStructSetData ($tBlend, 'Format', 1)
_WinAPI_UpdateLayeredWindow ($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC (0, $hScrDC)
_WinAPI_SelectObject ($hMemDC, $hOld)
_WinAPI_DeleteObject ($hBitmap)
_WinAPI_DeleteDC ($hMemDC)
EndFunc ;==> _SetBitmap ()
Func _ImageResize ($sInImage, $newW, $newH, $sOutImage = '')
Local $oldImage, $GC, $newBmp, $newGC
If $sOutImage = '' Then _GDIPlus_Startup ()
$oldImage = _GDIPlus_ImageLoadFromFile ($sInImage)
$GC = _GDIPlus_ImageGetGraphicsContext ($oldImage)
$newBmp = _GDIPlus_BitmapCreateFromGraphics ($newW, $newH, $GC)
$newGC = _GDIPlus_ImageGetGraphicsContext ($newBmp)
_GDIPlus_GraphicsDrawImageRect ($newGC, $oldImage, 0, 0, $newW, $newH)
_GDIPlus_GraphicsDispose ($GC)
_GDIPlus_GraphicsDispose ($newGC)
_GDIPlus_ImageDispose ($oldImage)
If $sOutImage = '' Then
Return $newBmp
Else
_GDIPlus_ImageSaveToFile ($newBmp, $sOutImage)
_GDIPlus_BitmapDispose ($newBmp)
_GDIPlus_Shutdown ()
Return 1
EndIf
EndFunc ;==> _ImageResize ()