The Un-Official Proxomitron Forum

Full Version: Volume Settings...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anyone know of any programs or registry settings that will LOCK the control panel volume settings? It is an EXTREME nuisance when applications like my TV-tuner card "take control" over those settings but do not return them "properly" when exited...
ProxRocks;
Quote:Does anyone know of any programs or registry settings that will LOCK the control panel volume settings? ....
My answer is, Nope, I know nossink about such a beast. But I can make a kludge fix for you, depending on a few things. :P

If you are running the TV software from within another proggie, this gets difficult, but not necessarily impossible. If you're running it from either a shortcut or a file association (by clicking on it in File Mangler), then the following should do the trick.

Step 1: Make a short batch file that will call the TV software for you. That batch file becomes your main "executable" that you associate with the proper file extensions. Nothing new so far, right? Stick around, it gets interesting. Sad

Step 2: Determine the proper registry keys and values that you want to have restored to their prior values. Backup those values into a .reg file somewhere safe (meaning a folder you don't ordinarily mess around in). Test the validity of your selections by running the TV software, which presumably will alter the settings in question. Now merge the .reg file that you just made. Did everything go back to where you want it? Good, let's move on. But if merging those keys/values didn't work, re-do this step until you get it right.

Step 3: Append the following command to the end of your new batch file:
Code:
regedit [pathname][filename]
"But wait, this crazy two-line batch doesn't work", you say. Sure, and I've left the best part for last now, didn't you know? :P Windows presents us with a problem when running batch files - it multi-threads the file, running one command right after another, without waiting for any of them to finish before going on to the next command. To solve this problem, use the Start command. For example:
Code:
start /w [tv_software] [%1 %2.....]
start /w regedit /s [settings restoration file]
This will force a linear execution, so that the registry isn't reset until after the TV stuff has ended. (The slash-s stands for "silent" mode, so that you don't see the dialog box about a successful merge.)

That's just about all there is to it, unless you answer the next question in the positive. Do your setting change around a lot? If they stay pretty much the same, then read no further, we're done. If they do change often, then we need to take one more step before we can walk away from this mess.

If your answer was Yes, then you'll need to re-capture those values every time the batch file runs. You can also do that with regedit, but this time with a command line switch to backup certain keys/values. Here's how its done:
Code:
regedit.exe /e [file name here] [key name here]
The slash-e does the export job.

To complete the command in your batch file, we'll combine it with the start command:
Code:
start /w regedit /e [file name here] [key name here]
And there you go, all wrapped up and ready to go. Kinda kludgy, but it works wonders for recalcitrant or mis-behaved proggies. No need to wait for some hack to code up a fix for your esoteric software - just write your own batch file, using these ideas as a jumping-off point.

Here's the whole enchilada in one place;
Code:
start /w regedit /e [file name here] [key name here]
start /w [tv_software] [%1 %2.....]
start /w regedit /s [settings restoration file]
Hope this feeble effort was what you needed. Smile!


Oddysey
Reference URL's