Gui Added. Admin Warning added. Config file added
This commit is contained in:
parent
239f751f2b
commit
e698301693
@ -2,45 +2,32 @@
|
|||||||
#Persistent ; Keep the script running until the user exits it.
|
#Persistent ; Keep the script running until the user exits it.
|
||||||
Menu, Tray, Tip , Default Audio Device Changer
|
Menu, Tray, Tip , Default Audio Device Changer
|
||||||
Menu, Tray, NoStandard
|
Menu, Tray, NoStandard
|
||||||
Menu, Tray, Add, Exit, MenuExit ; Creates a new menu item.
|
|
||||||
|
|
||||||
|
Menu, Tray, Add, Info, InfoMenu
|
||||||
|
Menu, Tray, Add, Exit, MenuExit
|
||||||
|
|
||||||
|
versionnumber := "1.1"
|
||||||
|
device1 := "Headset"
|
||||||
|
device2 := "Lautsprecher"
|
||||||
|
|
||||||
|
if not A_IsAdmin
|
||||||
|
{
|
||||||
|
msgbox, 48,Administrator Rights Warning, Please run as Admin.
|
||||||
|
sleep, 250
|
||||||
|
exitapp
|
||||||
|
}
|
||||||
|
|
||||||
; if not A_IsAdmin
|
|
||||||
; {
|
|
||||||
; msgbox, 48,%title% Administrator Rights Warning. Please run as Admin.
|
|
||||||
; sleep, 250
|
|
||||||
; exitapp
|
|
||||||
; }
|
|
||||||
|
|
||||||
installed_in=%A_ScriptDir%
|
installed_in=%A_ScriptDir%
|
||||||
IfExist, %installed_in%\hyperaudio.ini
|
IfExist, %installed_in%\hyperaudio.ini
|
||||||
{
|
{
|
||||||
iniread, audioname1, %installed_in%\hyperaudio.ini, Devices, Output1, Headset
|
iniread, device1, %installed_in%\hyperaudio.ini, Devices, Output1, %device1%
|
||||||
iniread, audioname2, %installed_in%\hyperaudio.ini, Devices, Output2, Lautsprecher
|
iniread, device2, %installed_in%\hyperaudio.ini, Devices, Output2, %device2%
|
||||||
} else {
|
} else {
|
||||||
iniwrite, Headset, %installed_in%\hyperaudio.ini, Devices, Output1
|
iniwrite, %device1%, %installed_in%\hyperaudio.ini, Devices, Output1
|
||||||
iniwrite, Lautsprecher, %installed_in%\hyperaudio.ini, Devices, Output2
|
iniwrite, %device2%, %installed_in%\hyperaudio.ini, Devices, Output2
|
||||||
iniread, audioname1, %installed_in%\hyperaudio.ini, Devices, Output1, Headset
|
|
||||||
iniread, audioname2, %installed_in%\hyperaudio.ini, Devices, Output2, Lautsprecher
|
|
||||||
}
|
}
|
||||||
; installed_in=%A_ScriptDir%\
|
|
||||||
; goto start_install
|
|
||||||
|
|
||||||
; start_install:
|
|
||||||
; IfExist, %installed_in%\hyperaudio.ini
|
|
||||||
; {
|
|
||||||
; ; Filedelete, %A_WorkingDir%\%fishmongernickname%_setup.exe
|
|
||||||
; }
|
|
||||||
|
|
||||||
|
|
||||||
device1:=audioname2
|
|
||||||
device2:=audioname1
|
|
||||||
|
|
||||||
; MsgBox, % device1
|
|
||||||
; MsgBox, % device2
|
|
||||||
|
|
||||||
; http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/
|
|
||||||
Devices := {}
|
Devices := {}
|
||||||
IMMDeviceEnumerator := ComObjCreate("{BCDE0395-E52F-467C-8E3D-C4579291692E}", "{A95664D2-9614-4F35-A746-DE8DB63617E6}")
|
IMMDeviceEnumerator := ComObjCreate("{BCDE0395-E52F-467C-8E3D-C4579291692E}", "{A95664D2-9614-4F35-A746-DE8DB63617E6}")
|
||||||
|
|
||||||
@ -111,3 +98,32 @@ MenuExit:
|
|||||||
ExitApp
|
ExitApp
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
||||||
|
InfoMenu:
|
||||||
|
{
|
||||||
|
Gui, 2:+AlwaysOnTop +Caption +MinimizeBox +ToolWindow ; +SysMenu
|
||||||
|
|
||||||
|
Gui, 2:Font, s20, Impact
|
||||||
|
Gui, 2:Add, Text, x15 y20 w280 r1 , HyperAudio, 2021
|
||||||
|
|
||||||
|
Gui, 2:Font, s8, Lucida Sans Unicode
|
||||||
|
Gui, 2:Add, Button, x255 y190 w50 h30 gInfoclose vInfoclose, OK
|
||||||
|
Gui, 2:Add, Text, x15 y60 w200 +Left, Alt+WheelUp:`nAlt+WheelDown:
|
||||||
|
Gui, 2:Add, Text, x105 y60 w200 +Left, Increase Volume +5`nDecrease Volume +5
|
||||||
|
|
||||||
|
|
||||||
|
Gui, 2:Add, Text, x15 y100 w200 +Left, Ctrl+F12
|
||||||
|
Gui, 2:Add, Text, x105 y100 w200 +Left, Toggle Audio Output Device`n(Configure Device Names in ini File)
|
||||||
|
|
||||||
|
Gui, 2:Add, Text, x15 y150 w200 +Left, Version: %versionnumber%
|
||||||
|
Gui, 2:Add, Text, x15 y175 w200 +Left, Shimao-Blackrock
|
||||||
|
|
||||||
|
Gui, 2:Show, h235 w320, HyperAudio
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
Infoclose:
|
||||||
|
{
|
||||||
|
Gui, 2:Destroy
|
||||||
|
}
|
||||||
|
return
|
||||||
|
BIN
HyperAudio.exe
BIN
HyperAudio.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user