;==================================================== ;================= Example of a GUI ================= ;==================================================== ; AutoIt version: 3.0.103 ; Language: English ; Author: "SlimShady" ; ; ---------------------------------------------------------------------------- ; Script Start ; ---------------------------------------------------------------------------- ;Include constants #include #include #cs $temp = ProcessList ( @ScriptName ) If $temp[0][0]>1 Then ;MsgBox(0, "ElciTimer", "ElciTimer già avviato. Controlla l'esecuzione dall'icona nella barra delle applicazioni "&@CRLF&"(vicino all'orologio in basso a destra del desktop)") Exit EndIf #ce ;Initialize variables Global $GUIWidth Global $GUIHeight Global $largbutt = 300 Global $leftButt = 2 $GUIWidth = $largbutt + 5 $GUIHeight = 650 ;Create window GUICreate("Musica", $GUIWidth, $GUIHeight, 0,0) GUISetState($GUI_ONTOP) GUISetFont (18, $largbutt, 2, "Verdana") ;Create a button $dist = 70 $i=10 $b1 = GUICtrlCreateButton("&MO", $leftButt, $i, $largbutt, 50) $i=$i+70 $b2 = GUICtrlCreateButton("musica &incoming", $leftButt, $i, $largbutt, 50) $i=$i+70 $b3 = GUICtrlCreateButton("ultimo &tg", $leftButt, $i, $largbutt, 50) $i=$i+70 $b4 = GUICtrlCreateButton("&standby", $leftButt, $i, $largbutt, 50) $i=$i+70 $b5 = GUICtrlCreateButton("&e:\incoming", $leftButt, $i, $largbutt, 50) $i=$i+70 $b6 = GUICtrlCreateButton("&kill mplayerc.exe", $leftButt, $i, $largbutt, 50) $i=$i+70 $b7 = GUICtrlCreateButton("el&citimer", $leftButt, $i, $largbutt, 50) $i=$i+70 $b8 = GUICtrlCreateButton("&wave volume 20%", $leftButt, $i, $largbutt, 50) $i=$i+70 $b9 = GUICtrlCreateButton("w&ave volume 90%", $leftButt, $i, $largbutt, 50) ;Show window/Make the window visible GUISetState(@SW_SHOW) While 1 ;After every loop check if the user clicked something in the GUI window $msg = GUIGetMsg() Select ;Check if user clicked on the close button Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $b1 If ProcessExists("w.exe") Then Run("process -k w.exe") Else Run("w monoff") EndIf ;DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', WinGetHandle('[CLASS:Progman]'), 'int', 274, 'int', 61808, 'int', 2) GUIDelete() Exit Case $msg = $b2 Run ( """C:\Programmi\K-Lite Codec Pack\Media Player Classic\mplayerc.exe"" e:\documenti\musica\incoming\* " ) GUIDelete() Exit Case $msg = $b3 InetGet("http://vfs3dg.vcast.it/JPodcast/Vfaucet/vfs3d/8B/mGAvQCxj1nmJY98SM8TDmRz9o3GHif0E","temp.tmp") $s = FileRead("temp.tmp") $ar = StringSplit($s, """") ;_ArrayDisplay($ar) $p = _ArraySearch ($ar, ".mp4", 0, 0, 0, True) $e = """e:\applicazioni\VIDEO&DIVXALL\vlc\vlc.exe"" " & $ar[$p+1] & " --fullscreen --volume=500 " Run ( $e ) ;ClipPut($e) GUIDelete() Exit Case $msg = $b4 Shutdown(32) GUIDelete() Exit Case $msg = $b5 Run ( "explorer e:\incoming" ) GUIDelete() Exit Case $msg = $b6 Run ( "Process -k mplayerc.exe" ) GUIDelete() Exit Case $msg = $b7 Run("E:\programmazione\AUTOIT\elcitimer\ELCITimer30.exe") GUIDelete() Exit Case $msg = $b8 SoundSetWaveVolume (20) GUIDelete() Exit Case $msg = $b9 SoundSetWaveVolume (90) GUIDelete() Exit EndSelect WEnd