Jump to content

How To Test For A Checked Box?


Recommended Posts

I'm trying to set microphone properties within C:\WINDOWS\system32\sndvol32.exe.

The problem I have is that some of my computers already have it setup correctly. I'd like to test whether the microphone is being muted or not. Can anyone think of a way to do that?

Thanks!

Link to comment
Share on other sites

  • 1 year later...

ControlCommand() and IsChecked command

OK! I got this far with my script. Can't seem to get it just right. Can you help me?

if ControlCommand ( "Volume Control", "Volume", "[TEXT:&Mute], "IsChecked", ) then

MsgBox(4096, "mute check", "Master Volume is muted", 10)

Else

MsgBox(4096, "mute check", "Master Volume is NOT muted", 10)

endif

I get a syntax error on the 1st line...

post-97-12596215844142_thumb.jpg

Link to comment
Share on other sites

OK! I got this far with my script. Can't seem to get it just right. Can you help me?

if ControlCommand ( "Volume Control", "Volume", "[TEXT:&Mute], "IsChecked", ) then

MsgBox(4096, "mute check", "Master Volume is muted", 10)

Else

MsgBox(4096, "mute check", "Master Volume is NOT muted", 10)

endif

I get a syntax error on the 1st line...

try replacing the first line with this:

if ControlCommand ( "Volume Control", "Volume", "[TEXT:&Mute]", "IsChecked" ) then

...just removed the last comma, and added a "

Edited by andybiochem
- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

try replacing the first line with this:

if ControlCommand ( "Volume Control", "Volume", "[TEXT:&Mute]", "IsChecked" ) then

...just removed the last comma, and added a "

that didn't help still getting syntax error on the 1st line after removing the comma...
Link to comment
Share on other sites

that didn't help still getting syntax error on the 1st line after removing the comma...

did you add the " as well..... I edited my post within a minute or so of making it

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

Yes that was the problem. I thought I was going nuts since I copied the command line from your post and pasted it - before you edited it...

Now with the quote it works just fine... Thanks a ton!

Oh! Oh! the first line does not get a syntax error, but the script displays the same message no matter if the volume is muted or not..

I did make a slight change, but it did not help...

if ControlCommand ( "Volume Control", "Volume", "[TEXT:&Mute]", "IsChecked" ) = 1 then

added the = 1

The msg is NOT muted no matter what...

Link to comment
Share on other sites

Oh! Oh!  the first line does not get a syntax error,  but the script displays the same message no matter if the volume is muted or not..

I did make a slight change, but it did not help...

if ControlCommand ( "Volume Control", "Volume", "[TEXT:&Mute]", "IsChecked" ) = 1 then

added the = 1

The msg is NOT muted   no matter what...

You have wrong ClassNameNN for checkbox control.

Run Au3Info move cursor above checkbox and look at Control Tab at value for ClassNameNN.

Then use it this way:

if ControlCommand ( "Volume Control", "Volume", "ClassNameNN", "IsChecked" ) = 1 then

Link to comment
Share on other sites

You have wrong ClassNameNN for checkbox control.

Run Au3Info move cursor above checkbox and look at Control Tab at value for ClassNameNN.

Then use it this way:

Thanks for idea, but

That does not work, this does:

if ControlCommand('[CLASS:Volume Control]', '', 1000, 'isChecked') then

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...