TreatJ Posted Thursday at 09:58 PM Posted Thursday at 09:58 PM It has been a minute since I have uploaded one of my scripts. This is a very simple one! In a nutshell this program opens the MS Sound Window, Selects a Playback Device and Check its Mute status. If it finds that it is Muted then the appropriate Button is clicked on to UnMute it. That's it! If you want the Program to check and UnMute (if needed) ALL of the Playback Devices in the list then use a For/Next Loop. I have made that very simple to implement within my script. Just open it up to see what I am talking about, I used Windows 11 NotePad v11.2410.21.0 / Font: Consolas / Regular / 12 as an Editor. I am somewhat "OCD" when it comes to lining up my script. I also find it easier to read when I look at my code sometime later! Having it line up helps me to read it better. Anyway, Script is attached.... Any feedback would be much appreciated... MuteCheckerV100.au3 CYCho 1
CYCho Posted 23 hours ago Posted 23 hours ago (edited) My desktop is Windows 11 v24H2 Korean version. After a couple of localization changes, I was thinking of doing something similar for my zPlayer. ControlCommand($CWHandle, "", "SysTabControl321", "TabRight") changed to: $tabHandle = ControlGetHandle($CWHandle, "", 12320) ControlClick($CWHandle, "", $tabHandle, "left", 1, 25 + ($TabsLoop - 1) * 50, 12) If $IconBnTx = "&Mute" Then changed to: If $IconBnTx = "음소거(&M)" Then Edited 16 hours ago by CYCho zPlayer - A Small Audio and Video Player
TreatJ Posted 12 hours ago Author Posted 12 hours ago Thanks for your feedback! I can see that you are a much better coder then me Anyway I do have a few questions.... ControlCommand($CWHandle, "", "SysTabControl321", "TabRight") changed to: $tabHandle = ControlGetHandle($CWHandle, "", 12320) ControlClick($CWHandle, "", $tabHandle, "left", 1, 25 + ($TabsLoop - 1) * 50, 12) If $IconBnTx = "&Mute" Then changed to: If $IconBnTx = "음소거(&M)" Then 1. From what I understand per AutoIt Help... ControlGetHandle returns: the handle (HWND) value So I don't understand how $tabHandle can be used as a controlID number in ControlClick 2. I don't fully understand how you are calculating the X/Y position (25 + ($TabsLoop - 1) * 50, 12) 3. If $IconBnTx = "&Mute" Then changed to: If $IconBnTx = "음소거(&M)" Then Here I am guessing that your change to my code has something do with Version of Windows that you are using. Again THANKS for you feedback...
CYCho Posted 6 hours ago Posted 6 hours ago (edited) 9 hours ago, TreatJ said: So I don't understand how $tabHandle can be used as a controlID number in ControlClick $CWHandle is a window handle and $tabHandle is the handle of the tab control. ControlClick() requires both. 9 hours ago, TreatJ said: I don't fully understand how you are calculating the X/Y position (25 + ($TabsLoop - 1) * 50, 12) It would be better to use a control handle if it is easy to get and is applicable worldwide. I used AutoIt v3 Info Tool (Au3Info.exe in AutoIt installation folder) to find the coordinates of tabs. 9 hours ago, TreatJ said: I am guessing that your change to my code has something do with Version of Windows Yes, you are right. Please refer to the following link for another post of mine. This code does the same thing as your code does and more. _MasterVolume() function takes approximately 10 milliseconds for each cycle. Edited 2 hours ago by CYCho zPlayer - A Small Audio and Video Player
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