All pastes #639575 Raw Edit

Miscellany

public text v1 · immutable
#639575 ·published 2007-07-30 17:50 UTC
rendered paste body
#include <GUIConstants.au3>
Opt("TrayAutoPause", 0)
Opt("traymenumode", 1)
Opt("WinTitleMatchMode", 4)
Dim $Version = "2.1"
Dim $Title
Dim $OldTitle

$aboutitem = TrayCreateItem("About")
$Exititem = TrayCreateItem("Exit")
$Toast = GUICreate("Toaster", 256, 128, @DesktopWidth - 256, @DesktopHeight - 155, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$pic = GUICtrlCreatePic(@ScriptDir & "\resources\splash.bmp", 0, 0, 256, 128)
$label1 = GUICtrlCreateLabel("Current Song:", 10, 25, 100, 25)
GUICtrlSetStyle($label1, -1, $WS_EX_TRANSPARENT)
GUICtrlSetStyle($label1, $DS_SETFOREGROUND)
GUICtrlSetFont($label1, 9, 400, -1, "Arial Bold")
GUICtrlSetBkColor($label1, $GUI_BKCOLOR_TRANSPARENT)
$SongCaption = GUICtrlCreateLabel("", 12, 50, 220, 70, -1, $WS_EX_TRANSPARENT)
GUICtrlSetFont($SongCaption, 9, 400, -1, "Arial Bold")
GUICtrlSetBkColor($SongCaption, $GUI_BKCOLOR_TRANSPARENT)
While 1
	$msg = TrayGetMsg()
	Select
		Case $msg = $aboutitem
			MsgBox(64, "About:", "Winamp Toaster v2.1" & @CRLF & "Created by Death Pax")
		Case $msg = $Exititem
			Exit
	EndSelect
	$OldTitle = $Title
	$Title = WinGetTitle("classname=Winamp v1.x")
	$Title = StringTrimRight($Title, 9)
	$Spot = StringInStr($Title, ". ")
	$Spot = $Spot + 1
	$Title = StringTrimLeft($Title, $Spot)
	If $OldTitle <> $Title Then
		PopToast($Toast, $Title)
	EndIf
	Sleep(50)
WEnd

Func PopToast($hwnd, $song)
	GUICtrlSetData($SongCaption, $song)
	DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040008);slide-in from bottom
	Sleep(5000)
	DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050004);slide-out to bottom
EndFunc   ;==>PopToast