Mi serviva una benedetta sveglia che facesse partire una canzone che sceglievo io all'ora che volevo. A un certo punto mi sono rotto le palle di usare sempre tool tarocchi scaricati in rete e con diecimila installazioni e nemmeno una utilità, quindi me la sono fatta da solo :asd:
CODICE
#include <GUIConstants.au3>
#include <ie.au3>
TraySetState(2)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Sveglia! by Gianluca Segato - Figherrimo", 441, 260, 193, 125)
$Label2 = GUICtrlCreateLabel(":", 72, 40, 7, 17)
$Group1 = GUICtrlCreateGroup("", 8, 8, 137, 89)
$Label1 = GUICtrlCreateLabel("Ora : Min", 24, 24, 89, 17)
$h1 = GUICtrlCreateInput(@HOUR, 24, 48, 33, 21)
$m1 = GUICtrlCreateInput(@MIN, 88, 48, 33, 21)
$Label3 = GUICtrlCreateLabel(":", 72, 48, 7, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 160, 8, 273, 89)
$file1 = GUICtrlCreateLabel("File Audio:", 168, 24, 53, 17)
$f1 = GUICtrlCreateInput("", 224, 24, 201, 21)
$choose = GUICtrlCreateButton("Scelgi il file da Esplora Risorse", 208, 56, 171, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$attiva = GUICtrlCreateButton("Attiva!", 160, 112, 75, 41, 0)
$Group3 = GUICtrlCreateGroup("", 64, 176, 289, 73)
$Label4 = GUICtrlCreateLabel("(c) Copyright Gianluca Segato - Figherrimo", 104, 192, 202, 17)
$visit = GUICtrlCreateButton("Visita il sito!", 160, 216, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
if @OSVersion = "WINVISTA" then
$path = "C:\Users\"&@UserName&"\Musica\*.mp3"
Else
$path = "C:\Documents and Settings\"&@UserName&"\Musica\*.mp3"
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $attiva
$h = GuiCtrlRead($h1)
$m = GuiCtrlRead($m1)
$file = GuiCtrlRead($f1)
GUISetState(@SW_HIDE)
MsgBox(64, "Sveglia!", "Attenzione!"&@CRLF&"L'allarme è stato impostato per le ore "&$h&":"&$m)
Do
until @HOUR = $h and @MIN = $m
ShellExecute($file)
MsgBox(64, "Sveglia", "Sono le ore "&@HOUR&":"&@MIN&" ed è ora di svegliarsi!"&@CRLF&@CRLF&@CRLF&"Messaggio generato automaticamente da Sveglia - Figherrimo's Software")
Exit
case $choose
$file = FileOpenDialog("Scelgi un file musicale da avviare", "Scelgi un file musicale", "Music (*.mp3;*.wav,*.wma,*.ogg,*.mov,*.wmv,*.mp4,*.mp2,*.avi)", 1, $path)
GUICtrlSetData($f1, $file)
case $visit
_IECreate("http://figherrimo.netsons.org/")
EndSwitch
WEnd