Get the exact windows volume and control it with a track

Posted on 2014-08-30
Last Modified: 2014-08-30

I got a way to do that but the problem is that I would like to control it with a track bar where

min = 0
max = 100
step = 10

I got the solution here: track bar

I changed the function to this

Function LerVolume(): Integer;
  Vol : DWORD;
  Result := Round(loWord(Vol) / 655.35);

Open in new window

I thank in advanced a help
Question by:hidrau
    LVL 25

    Accepted Solution

    because full volume is 65535 and silence is 0 - you must translate your range 0..100 to 0..65535:

    SetWaveVolume(muldiv(65535, trackbar.position, 100));

    Open in new window

    ...get value for trackbar:
      Vol : DWORD;
      Result := (100 * loWord(Vol)) div 65535;

    Open in new window

    LVL 1

    Author Closing Comment

    Once again, Thanks very much Sinsav.

    I understood :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now