IanN1990 Posted January 14, 2012 Share Posted January 14, 2012 (edited) I have noticed, when i do a system-wide mute on my computer i can still hear the programs even if they r fan so i decided to fix this When the application is muted, u hear no sound. So i thought if i hotkey the system mute and then make a loop to mute every app Opt('WinTitleMatchMode', 2 ) HotKeySet("{Volume_Mute}", "SystemMute") while 1 sleep(1000) WEnd Func SystemMute() For $i = 1 to 25 step 1 ControlClick("Volume Mixer", "", "[CLASS:ToolbarWindow32; INSTANCE:$i]", "Left", 1) Next EndFunc How can i make it so the loop increases the Instances by +1 every go ? Edited April 14, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 14, 2012 Moderators Share Posted January 14, 2012 IanN1990,Set $i as a variable and not part of the literal string: ControlClick("Volume Mixer", "", "[CLASS:ToolbarWindow32; INSTANCE:" & $i & "]", "Left", 1)And you do not need Step 1 - that is the default. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
IanN1990 Posted January 14, 2012 Author Share Posted January 14, 2012 ah i see, thanks Link to comment Share on other sites More sharing options...
IanN1990 Posted January 14, 2012 Author Share Posted January 14, 2012 (edited) Here is the finished code for everyone Opt('WinTitleMatchMode', 2 ) HotKeySet("{Volume_Mute}", "SystemMute") while 1 sleep(1000) WEnd Func SystemMute() For $i = 1 to 25 if ControlGetText("Volume Mixer", "","[CLASS:ToolbarWindow32; INSTANCE:" & $i & "]") = "Mute Main" Then ElseIf ControlGetText("Volume Mixer", "","[CLASS:ToolbarWindow32; INSTANCE:" & $i & "]") > "Mute for" then ControlClick("Volume Mixer", "", "[CLASS:ToolbarWindow32; INSTANCE:" & $i & "]", "Left", 1) EndIf next EndFunc It only works though if your keyboard/mouse's "mute button" sends the Volume_Mute for the hotkey to detect. I am working on other wise for it to detect for keybaords that dont send this command and i will update this post if i find a way Edited January 14, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now