Код:
#include <GUIConstants.au3> #include <file.au3> AutoItSetOption ( "WinTitleMatchMode", 2 ) Run("foobar2000.exe") WinWait("foobar2000", "Buttons") $WidRad = 100 $HeiRad = 20 $NumRad = 3 $Border = 10 Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $size = WinGetPos( "Program Manager") $size1 = WinGetPos("foobar2000", "Buttons") $mainwindow = GUICreate("Погонялко", $WidRad+$Border*2, $HeiRad*$NumRad+$Border*2+12, $size1[2]/2-$WidRad/2-$Border, $size[3]/2-$HeiRad*$NumRad/2-$Border, 0, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) Select Case $size1[0] > $WidRad WinMove ("Погонялко", "", $size1[0]-$WidRad-$Border*2, 0) Case $size[2]-$size1[0]-$size1[2] > $WidRad WinMove ("Погонялко", "", $size1[0]+$size1[2], 0) EndSelect GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $Radio1 = GUICtrlCreateRadio ( "Без контроля", $Border, $Border+$HeiRad*0, $WidRad, $HeiRad) $Radio2 = GUICtrlCreateRadio ( "Режим аудио", $Border, $Border+$HeiRad*1, $WidRad, $HeiRad) $Radio3 = GUICtrlCreateRadio ( "Режим видео", $Border, $Border+$HeiRad*2, $WidRad, $HeiRad) GUISwitch($mainwindow) GUISetState(@SW_SHOW) GUICtrlSetState ( $Radio1, $GUI_CHECKED) $Factive = 1 $Mactive = 0 While WinExists("foobar2000", "Buttons") = 1 Select Case WinActive ("foobar2000", "Buttons") = 1 and $Factive = 0 GUISetState(@SW_SHOW) WinActivate ("foobar2000", "Buttons") $Factive = 1 Case WinActive ("foobar2000", "Buttons") = 0 and $Factive = 1 and WinActive ("Погонялко", "") = 0 GUISetState(@SW_HIDE) $Factive = 0 EndSelect Sleep(500) ; Idle around if GUICtrlRead ( $Radio1 ) = $GUI_CHECKED then Else if WinExists ("Media Player Classic Homecinema", "") = 1 then $var = WinList("Media Player Classic Homecinema", "") if $var[0][0] > 1 then WinClose ($var[2][0]) $Mactive = 0 EndIF $var1 = WinList("foobar2000", "Buttons") if $var1[0][0] > 0 and StringLen ( $var1[1][0] ) > 11 then WinClose ($var[1][0]) $Mactive = 0 EndIF EndIF if WinExists ("Media Player Classic Homecinema", "") = 1 and $Mactive = 0 then $Mactive = 1 Select Case GUICtrlRead ( $Radio2 ) = $GUI_CHECKED WinSetState ("Media Player Classic Homecinema", "", @SW_MINIMIZE) Case GUICtrlRead ( $Radio3 ) = $GUI_CHECKED WinSetState ("Media Player Classic Homecinema", "", @SW_RESTORE) WinActivate ("Media Player Classic Homecinema", "") Send("{ENTER}") EndSelect EndIF if WinExists ("Media Player Classic Homecinema", "") = 0 and $Mactive = 1 then $Mactive = 0 if WinExists("foobar2000", "Buttons") then $var1 = WinList("foobar2000", "Buttons") if StringLen ( $var1[1][0] ) < 11 then Send("^+{DOWN}") EndIF EndIF EndIF EndIF WEnd CLOSEClicked() Func CLOSEClicked() While WinExists("Media Player Classic Homecinema", "") = 1 $var = WinList("Media Player Classic Homecinema", "") if $var[0][0] > 0 then WinClose ($var[1][0]) WEnd Exit EndFunc