Results 1 to 7 of 7

Thread: Vista Master Volume Level - how to get it?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    2

    Question Vista Master Volume Level - how to get it?

    Hi there. This is my first thread and i hope i put it in the right place. Here is my question:
    I have an application written in VB 2005 and i want to find out what's the master volume level (in Windows Vista) at a particular time. I found something on the web, but it's written in C language and I am not familiar with it. Can anyone help me?
    Thanks!

  2. #2
    New Member
    Join Date
    Nov 2008
    Posts
    1

    Re: Vista Master Volume Level - how to get it?

    I recently had this problem when trying to make a remote control circuit to control my PC volume and other functions... It seems that most code for vb which achieves this goal is unsuccessful because it just gives you local application volume control!

    Being more of a C++ programmer myself I actually used some suggestions from various sites to build a simple DLL that I could call from vb (attached). I don't think it will work for XP but it worked on my Vista system...

    To Call:
    VBCode Code:
    1. Private Declare Function GetVolume Lib "SystemHWInterface.dll" () As Double
    2.     Private Declare Sub SetVolume Lib "SystemHWInterface.dll" (ByVal volume As Double)
    3.  
    4. 'Get volume
    5. Dim dVolumeLevel As Double
    6. dVolumeLevel = GetVolume()
    7.  
    8. 'Set volume to 50%
    9. SetVolume(0.5)

    Note that it gives you control of the master volume as a percentage.

    Hope this helps some of you guys out!
    Last edited by si_the_geek; Mar 4th, 2009 at 05:57 PM. Reason: removed attachment (just an executable file)

  3. #3
    New Member
    Join Date
    Feb 2009
    Posts
    4

    Re: Vista Master Volume Level - how to get it?

    Hi.

    That was very good library. Does it have any Mute functions?

  4. #4
    New Member
    Join Date
    Apr 2009
    Posts
    2

    Re: Vista Master Volume Level - how to get it?

    Last edited by si_the_geek; Mar 4th, 2009 at 04:57 PM. Reason: removed attachment (just an executable file)
    Seems like a handy DLL - any particular reason why it's been removed? I have been searching for something just like this!

  5. #5
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Vista Master Volume Level - how to get it?

    Quote Originally Posted by Radian View Post
    Seems like a handy DLL - any particular reason why it's been removed? I have been searching for something just like this!
    I think the main reason is the poster is not known, only has 1 post, hard to trust, and most programming sites don't allow or want you to post compiled code.

  6. #6
    New Member
    Join Date
    Apr 2009
    Posts
    2

    Re: Vista Master Volume Level - how to get it?

    OK, thanks Edgemeal - it did half cross my mind that a DLL might be a dodgy item to take on trust. Now that this post has been bumped into view - is anyone able to advise on how to deal with the Vista mixer using VB?

  7. #7
    New Member
    Join Date
    Jun 2009
    Posts
    10

    Re: Vista Master Volume Level - how to get it?

    Quote Originally Posted by Radian View Post
    is anyone able to advise on how to deal with the Vista mixer using VB?
    I would also need this, but could not find anything useful so far.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width