Jump to content

Recommended Posts

Posted

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

Posted (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 by CYCho
Posted

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...

Posted (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 by CYCho

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   1 member

×
×
  • Create New...