global $corz_welcome_version = "1.0.3" #include-once #include #include #include #include #cs corz welcome pulse v1.0.3 throbs the app icon once at launch (c) corz.org 2026->tomorrow CorzWelcomeThrob([$icon_source[, $icon_index[, $max_size[, $display_ms[, $peak_scale[, $fade_in_end]]]]]]) Usage: Call this once at startup, before the main window exists. Placement matters: after paths and preferences are known, after any second-instance early exit, before GUICreate and tray setup, do: #include "corzWelcome.au3" ; <-- this can go anywhere above the call. CorzWelcomeThrob() That shows icon (0-index, i.e. main program icon) from the running program file at 256 px, swelling to 110 percent size and fading out over 1 second, centred on the main screen. The window never takes focus, mouse clicks pass straight through it, so startup continues underneath. To configure the pulse, either pass values: CorzWelcomeThrob(default, default, 192) CorzWelcomeThrob(default, default, default, 700) CorzWelcomeThrob(default, default, default, default, 1.2) CorzWelcomeThrob(default, default, default, default, default, 0.4) or set the app-wide defaults once and call with no arguments: $corz_welcome_size = 192 $corz_welcome_ms = 700 $corz_welcome_peak = 1.2 $corz_welcome_fadein = 0.4 CorzWelcomeThrob() $icon_source defaults to the compiled program file, or to the AutoIt interpreter exe while running interpreted, so the pulse shows something sensible during development. Pass an explicit exe, dll or ico path to throb a different image. $icon_index selects which icon inside that file, 0 being the first. #ce ; App-wide defaults. Set any of these once before calling ; CorzWelcomeThrob() to tune every welcome pulse in that app. global $corz_welcome_size = 256 global $corz_welcome_ms = 1000 global $corz_welcome_peak = 1.1 global $corz_welcome_fadein = 0.15 ; Fixed limits. Passed values outside these ranges get clamped. global const $WELCOME_MIN_SIZE = 64 global const $WELCOME_MAX_SIZE = 512 global const $WELCOME_MIN_MS = 300 global const $WELCOME_MAX_MS = 5000 global const $WELCOME_MIN_PEAK = 1.0 global const $WELCOME_MAX_PEAK = 1.5 global const $WELCOME_MIN_FADEIN = 0.05 global const $WELCOME_MAX_FADEIN = 0.9 ; Fixed pulse shape. Kept as constants so the curve reads in one place. global const $WELCOME_FRAME_MS = 16 global const $WELCOME_START_SCALE = 0.82 global const $WELCOME_FADE_OUT_START = 0.25 global const $WELCOME_FULL_OPACITY = 255 ; Per-pixel alpha flag for $tagBLENDFUNCTION Format field (Win32 AC_SRC_ALPHA). global const $WELCOME_SRC_ALPHA = 0x01 ; ; CorzWelcomeThrob() ; ; Throbs the program icon once at full size on a transparent window. ; Returns true when the pulse displayed, false when no icon image ; could be extracted or GDIPlus could not start. ; ; Data in: $icon_source file path with the icon, default selects the ; compiled program file, or the interpreter exe when interpreted. ; $icon_index icon number inside that file, 0 is the first. $max_size ; icon box in pixels, 64 to 512, default $corz_welcome_size (256). ; $display_ms total pulse time in milliseconds, 300 to 5000, default ; $corz_welcome_ms (1100). $peak_scale swell at the middle of the ; pulse as a multiple of full size, 1.0 to 1.5, default ; $corz_welcome_peak (1.1). $fade_in_end point in the pulse, as a ; fraction of the total from 0.05 to 0.9, by which the icon reaches ; full opacity, default $corz_welcome_fadein (0.15). Data out: true on ; success, false on failure. The transform in one line: the requested ; icon is extracted at 256 px, drawn centred on a click-through ; layered window, scaled from 0.82 up to the peak and back to 1.0 ; while fading in over the first fraction and back out at the end. ; Quirks that bite: the pulse blocks the caller for $display_ms while ; it animates, so call it before the main loop starts; under a remote ; desktop session layered alpha can render flat, the pulse still shows ; but without smooth edges; when interpreted the icon comes from the ; AutoIt exe, which is expected and changes to the app icon once ; compiled. Called once per launch, never from inside a loop. ; func CorzWelcomeThrob($icon_source = default, $icon_index = default, $max_size = default, $display_ms = default, $peak_scale = default, $fade_in_end = default) local $icon_path = $icon_source if $icon_path = default or $icon_path = "" then if @Compiled then $icon_path = @ScriptFullPath else $icon_path = @AutoItExe endif endif local $fallback_path = @AutoItExe local $icon_number = $icon_index if $icon_number = default or $icon_number < 0 then $icon_number = 0 local $draw_size = $max_size if $draw_size = default then $draw_size = $corz_welcome_size if $draw_size < $WELCOME_MIN_SIZE then $draw_size = $WELCOME_MIN_SIZE if $draw_size > $WELCOME_MAX_SIZE then $draw_size = $WELCOME_MAX_SIZE local $draw_ms = $display_ms if $draw_ms = default then $draw_ms = $corz_welcome_ms if $draw_ms < $WELCOME_MIN_MS then $draw_ms = $WELCOME_MIN_MS if $draw_ms > $WELCOME_MAX_MS then $draw_ms = $WELCOME_MAX_MS local $draw_peak = $peak_scale if $draw_peak = default then $draw_peak = $corz_welcome_peak if $draw_peak < $WELCOME_MIN_PEAK then $draw_peak = $WELCOME_MIN_PEAK if $draw_peak > $WELCOME_MAX_PEAK then $draw_peak = $WELCOME_MAX_PEAK local $draw_fade = $fade_in_end if $draw_fade = default then $draw_fade = $corz_welcome_fadein if $draw_fade < $WELCOME_MIN_FADEIN then $draw_fade = $WELCOME_MIN_FADEIN if $draw_fade > $WELCOME_MAX_FADEIN then $draw_fade = $WELCOME_MAX_FADEIN local $icon_handle = _WinAPI_ShellExtractIcon($icon_path, $icon_number, $draw_size, $draw_size) if not $icon_handle then $icon_handle = _WinAPI_ExtractIcon($icon_path, $icon_number) if not $icon_handle and $icon_path <> $fallback_path then $icon_handle = _WinAPI_ShellExtractIcon($fallback_path, 0, $draw_size, $draw_size) endif if not $icon_handle then return false local $gdi_ok = _GDIPlus_Startup() if not $gdi_ok then _WinAPI_DestroyIcon($icon_handle) return false endif local $src_bitmap = _GDIPlus_BitmapCreateFromHICON32($icon_handle) _WinAPI_DestroyIcon($icon_handle) if not $src_bitmap then _GDIPlus_Shutdown() return false endif local $src_w = _GDIPlus_ImageGetWidth($src_bitmap) local $src_h = _GDIPlus_ImageGetHeight($src_bitmap) if $src_w <= 0 or $src_h <= 0 then _GDIPlus_ImageDispose($src_bitmap) _GDIPlus_Shutdown() return false endif local $canvas = Ceiling($draw_size * $draw_peak) + 4 local $gui_x = Int((@DesktopWidth - $canvas) / 2) local $gui_y = Int((@DesktopHeight - $canvas) / 2) if $gui_x < 0 then $gui_x = 0 if $gui_y < 0 then $gui_y = 0 local $welcome_gui = GUICreate("", $canvas, $canvas, $gui_x, $gui_y, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_TRANSPARENT, $WS_EX_NOACTIVATE), 0) GUISetState(@SW_SHOWNOACTIVATE, $welcome_gui) local $frames = Int($draw_ms / $WELCOME_FRAME_MS) if $frames < 8 then $frames = 8 local $frame = 0 while $frame <= $frames local $phase = $frame / $frames local $scale = $WELCOME_START_SCALE if $phase < 0.5 then $scale = $WELCOME_START_SCALE + ($draw_peak - $WELCOME_START_SCALE) * ($phase * 2) else $scale = $draw_peak - ($draw_peak - 1.0) * (($phase - 0.5) * 2) endif local $fade_in = $phase / $draw_fade if $fade_in > 1.0 then $fade_in = 1.0 local $fade_out = (1.0 - $phase) / $WELCOME_FADE_OUT_START if $fade_out > 1.0 then $fade_out = 1.0 local $opacity = $WELCOME_FULL_OPACITY if $fade_in < $fade_out then $opacity = Int($WELCOME_FULL_OPACITY * $fade_in) else $opacity = Int($WELCOME_FULL_OPACITY * $fade_out) endif CorzWelcomePaintFrame($welcome_gui, $src_bitmap, $src_w, $src_h, $canvas, $scale, $opacity) Sleep($WELCOME_FRAME_MS) $frame += 1 wend _GDIPlus_ImageDispose($src_bitmap) GUIDelete($welcome_gui) _GDIPlus_Shutdown() return true endfunc ; ; CorzWelcomePaintFrame() ; ; Draws one animation frame of the welcome pulse. Private helper for ; CorzWelcomeThrob(); not for direct use. Returns no value. ; ; Data in: $welcome_gui layered window to paint. $src_bitmap GDIPlus ; bitmap of the icon. $src_w and $src_h its pixel size. $canvas the ; square window size in pixels. $scale icon multiple of full size for ; this frame. $opacity 0 to 255 for this frame. Data out: none. The ; transform in one line: the icon is drawn scaled and centred on a ; transparent canvas which replaces the window contents through ; UpdateLayeredWindow. Quirks that bite: every struct and device ; context created here is released before return, so callers pass ; only the source bitmap and paint as often as required. ; func CorzWelcomePaintFrame($welcome_gui, $src_bitmap, $src_w, $src_h, $canvas, $scale, $opacity) local $draw_w = Int($src_w * $scale) local $draw_h = Int($src_h * $scale) if $draw_w > $canvas then $draw_w = $canvas if $draw_h > $canvas then $draw_h = $canvas if $draw_w < 1 then $draw_w = 1 if $draw_h < 1 then $draw_h = 1 local $dst_x = Int(($canvas - $draw_w) / 2) local $dst_y = Int(($canvas - $draw_h) / 2) local $canvas_bitmap = _GDIPlus_BitmapCreateFromScan0($canvas, $canvas, $GDIP_PXF32PARGB) if not $canvas_bitmap then return local $graphics = _GDIPlus_ImageGetGraphicsContext($canvas_bitmap) _GDIPlus_GraphicsClear($graphics, 0x00000000) _GDIPlus_GraphicsDrawImageRect($graphics, $src_bitmap, $dst_x, $dst_y, $draw_w, $draw_h) _GDIPlus_GraphicsDispose($graphics) local $screen_dc = _WinAPI_GetDC(0) local $mem_dc = _WinAPI_CreateCompatibleDC($screen_dc) local $hbmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($canvas_bitmap, 0x00000000) local $old_selected = _WinAPI_SelectObject($mem_dc, $hbmp) local $size_struct = DllStructCreate($tagSIZE) DllStructSetData($size_struct, "X", $canvas) DllStructSetData($size_struct, "Y", $canvas) local $src_struct = DllStructCreate($tagPOINT) DllStructSetData($src_struct, "X", 0) DllStructSetData($src_struct, "Y", 0) local $blend_struct = DllStructCreate($tagBLENDFUNCTION) DllStructSetData($blend_struct, "Alpha", $opacity) DllStructSetData($blend_struct, "Format", $WELCOME_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($welcome_gui, $screen_dc, 0, DllStructGetPtr($size_struct), $mem_dc, DllStructGetPtr($src_struct), 0, DllStructGetPtr($blend_struct), $ULW_ALPHA) _WinAPI_ReleaseDC(0, $screen_dc) _WinAPI_SelectObject($mem_dc, $old_selected) _WinAPI_DeleteObject($hbmp) _WinAPI_DeleteDC($mem_dc) _GDIPlus_BitmapDispose($canvas_bitmap) endfunc