RealOne Player Volume Bar Clone (Almost) | CodeGuru

RealOne Player Volume Bar Clone (Almost)

Environment: VC6 Introduction I love how the volume control of the RealOne player looks, so I decided to include it into my own applications. Because someone else may be interested in using it, here it is! Note that this code only obtains a value, and does not affect the current audio configuration. Usage To use […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 18, 2003
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: VC6

Introduction

I love how the volume control of the RealOne player looks, so I decided to include it into my own applications. Because someone else may be interested in using it, here it is!

Note that this code only obtains a value, and does not affect the current audio configuration.

Usage

To use this class, you only have to create the control using the Dialog Editor as an slide bar (and select the desired horizontal/vertical orientation).

Then, using the ClassWizard, link the resource to a CSlideBarCtrl variable. Finally, change the type of this variable (which is in the dialog class definition) from CSlideBarCtrl to CVolumeBar (do not forget the #include!).

To set the volume (the range is 0-100), use the function:

void SetVolume(int volume)

And to get the current volume value, use:

int GetVolume()

Additionally, you can change the background color and the bar color by modifying the public attributes bkColor and barColor.

Advertisement

Future Improvements

The 3D effect on the “thumb” is not yet implemented, and the control would look nicer with it.

Downloads


Download demo project – 16 Kb


Download source – 5 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.