Jump to content

[Solved] Commandline - Send message for increasing / decreasing / muting volume


IanN1990
 Share

Recommended Posts

I have done a little search on the internet and the only answer i can find is a .exe that when called from a shortcut can increase / decrease / volume but this isn't want i want.

I am aware that autoit has Send("{Volume up}"), Down and Mute but these sometimes have a few problems with them.

A. if the application is able to recevice send commands

b. is the application active

c. if i have a hotkey set for Vol up, i have to disable it first before sending, and then re-enable it so stop a never-ending loop.

So i was wondering.

Does anyone know a autoit-way "as i dislike having to have third-party software, i perfer to keep all the code within the code" of increasing, decreasing and muting the volume.

I do hope there is a simple cmd or sendmessage that could achive this ?

(Windows 7 64 bit)

Edited by IanN1990
Link to comment
Share on other sites

What have you tried? I can send those commands to any window and they work for me.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Well a week ago, i decided not to install my logitch software (Setpoint) which normally handled things like this. I found that HotkeySet, is sometimes very hit / miss. Works on some applications, not for all.

So doing some research i found Hotkey.au3 UDF(Extremely good peice of kit). So now i have more control over my keyboard i wanted to improve the funacility. Some full-screen applications, some windows console windows or infact even sometimes random applications like malwarebtyes doesn't recongise the send command.

As i have alot of free time atm, i am trying to make things alot more stable and more reliable.

My first idea was, as i have GUI running (hidden in the background for a flash hook) i could use a controlsend("", "", $GUIHandle, "{Volume_Mute}") but that only works if the GUI is active.

Plus as i said in my third thought, i need to "unhook" the volume, to send the volumte mute to stop endless loops. Something i would like to avoid. Ego why i started this post to see if there was a simple cmd or message so my hook could run that instead of using a send("Mute").

@Scullion I am checking out that post now to see if it will work, and will report back :)

Edited by IanN1990
Link to comment
Share on other sites

The only time you have to "unhook" your hotkey is if the hotkey is sending the same key that you used for that hotkey. If your script is using the Volume Up key, and the system sees that as the volume up key, that usually is all you'd need to have the volume go up. I have a keyboard with media keys on it, and they all work without any driver support, there's no extra software being used to get the volume control and mute button to do they're functions. You probably don't even need a script to adjust your volume for you if the keyboard has these already.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

@BrewManNH, You are correct. My keyboard has media keys and by default they work but again its all about me pressing it and knowing it will work first time every time. A good example is firefox. My keybaord cant send any vol up, down or mute if firefox is active. Which isn't great if i am watching a video and want to control my volume :)

Link to comment
Share on other sites

@Scullion I have been trying out the UDF you linked. Dispite being designed for Vista it is working very well on Windows 7. This does look very promsing for what i am after.

As it appears theres no cmd for this "from my research on the internet" and a sendmessage i donno then this provides a very good work around. :)

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