Jump to content

Control Vista+ Master Volume


wraithdu
 Share

Recommended Posts

  • 3 months later...
  • 1 month later...

PluinOpen returns a "handle" to the opende plugin which you can use in PluinClose. The first loaded plugin is assigned to index 0, but also 0 is returned for an error.

This wrapper-func should return -1 if the plugin can't be loaded.

Func _PluginOpen($DLL)
    ; Prog@ndy
    Local $handle = PluginOpen($DLL)
    If $handle > 0 Then Return $handle
    Local $aResult = DLLCall("Kernel32.dll", "ptr", "GetModuleHandleW", "wstr", StringReplace($DLL,"/","\"))
    If @error Or $aResult[0]=Ptr(0) Then Return SetError(1,0,-1)
    Return $handle
EndFunc
Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

PluinOpen returns a "handle" to the opende plugin which you can use in PluinClose. The first loaded plugin is assigned to index 0, but also 0 is returned for an error.

This wrapper-func should return -1 if the plugin can't be loaded.

Func _PluginOpen($DLL)
    ; Prog@ndy
    Local $handle = PluginOpen($DLL)
    If $handle > 0 Then Return $handle
    Local $aResult = DLLCall("Kernel32.dll", "ptr", "GetModuleHandleW", "wstr", StringReplace($DLL,"/","\"))
    If @error Or $aResult[0]=Ptr(0) Then Return SetError(1,0,-1)
    Return $handle
EndFunc
Returns (-1). Plugin does not work.
Link to comment
Share on other sites

I think the plugin needs VC 2008 redistributables. Try to install them:

http://www.microsoft.com/downloads/en/resu...p;stype=s_basic

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 months later...

Hello, wraithdu.

I found out your work while searching for a way to give a particular application the control of Vista/Win7 master volume.

The thing is that I have an old Sony Vaio laptop (VGN S2XP) that needs a special application (Sony Hotkey Utility) to control the laptop FN keys. The problem is that this program was designed for Windows XP and Sony doesn't support Vista on this laptop. As Vista/Win7 has per-application volume control, this program doesn't work anymore. It detects the VOL + and VOL -, but instead of changing master volume it only changes the volume associated with the app.

Here's a screenshot:

Posted Image

My hope was to "modify" this application so it could control directly Vista master volume. This utility consists of two .exe and two .dll files. I was thinking if there was some way to decompile this app and to adapt it using your plugin, but my programming skills aren't good enough. Do you think you can help me? Is this possible or is it an impossible mission?

The program can be downloaded here: Sony HotKey Utility.

Thanks in advance.

Link to comment
Share on other sites

Link to comment
Share on other sites

I am curious that Sony had written in the license agreement for this program? Do you think? :D

Maybe you like this.

Hmmm... That program is nice, although it doesn't detect my FN+VOL+ and FN+VOL- keys.

Regarding my previous questions... Do you think it is possible?

Link to comment
Share on other sites

No, not possible. No way can I hack Sony's program to change how it works. Your best bet is to try and find out how to detect your volume hot keys. Maybe write a keyboard hook and integrate it into my volume OSD script? Or try to find out what those hotkeys are exactly, and set them using AutoIt or a direct call to the RegisterHotKey API. You'll need to figure out what the virtual key code is for the FN key on a laptop though.

Edited by wraithdu
Link to comment
Share on other sites

Hello, wraithdu.

I found out your work while searching for a way to give a particular application the control of Vista/Win7 master volume.

The thing is that I have an old Sony Vaio laptop (VGN S2XP) that needs a special application (Sony Hotkey Utility) to control the laptop FN keys. The problem is that this program was designed for Windows XP and Sony doesn't support Vista on this laptop. As Vista/Win7 has per-application volume control, this program doesn't work anymore. It detects the VOL + and VOL -, but instead of changing master volume it only changes the volume associated with the app.

Here's a screenshot:

My hope was to "modify" this application so it could control directly Vista master volume. This utility consists of two .exe and two .dll files. I was thinking if there was some way to decompile this app and to adapt it using your plugin, but my programming skills aren't good enough. Do you think you can help me? Is this possible or is it an impossible mission?

The program can be downloaded here: Sony HotKey Utility.

Thanks in advance.

How skilled are you when it comes to more low-level winapi stuff? I would simply inject a dll that hooks the winapi function that handles setting the sound level (my guess: waveOutSetVolume) and then call a function that changes vista's sound level instead.

Some info on api hooking in my sig, if you still don't get it, hit me a pm and we'll see if we can work something out :)

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Link to comment
Share on other sites

Iteresting info on the Fn key, and good idea monoceres. Looks like it might be possible though to find out what virtual key code is being sent by the *combination* of the Fn+Vol keys. Then you can hook that, either with a global keyboard hook or with the RegisterHotKey api.

Link to comment
Share on other sites

How skilled are you when it comes to more low-level winapi stuff? I would simply inject a dll that hooks the winapi function that handles setting the sound level (my guess: waveOutSetVolume) and then call a function that changes vista's sound level instead.

Some info on api hooking in my sig, if you still don't get it, hit me a pm and we'll see if we can work something out :)

As I told before, my programing skills aren't good enough to make this on my own. I've only learned C in the university, but didn't practice anymore.

Could you help me getting this to work?

Link to comment
Share on other sites

Thanks for your quick reply, misunderstood purpose of script. I thought it was a script that actually affected vistaX64 OS software volume control. Having trouble with low volume output on my new systems onboard sound card. :)

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