I'm making a small program for a tvtunner.
One of its functions is the ability to change audio level (master/wave/linein...).
In Windows XP works fine.
In Vista/7 I know only IAudioEndpointVolume interface. It works only for master volume.
So, until I will find a better solution, I start the program in Windows XP compatibility.

My questions are:
1. Do somebody know a better way to change audio level directly in Vista/7..?
2. Is there a way to install the program directly with Windows XP compatibility set?
3. I need to know inside the program on which OS is running so I can make small adjustments. But, because of the compatibility, GetVersionEx says it's Windows XP even if it's Vista/7.
Is there a way to get real informations about the OS?

Thank you in advance for any reply.

For 2 and 3 I found solutions:

2. When I start the program I check registry for this:

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files\\Folder_of_the_program\\Name_of_the_program.exe"="WINXPSP3"

If it's not there then I add it and make the program restart itself.

3. I check for a function that exists only in Vista and Win 7:

var  hKernel32: HMODULE;
  IsVistaOrWin7: Boolean;
begin
   hKernel32 := GetModuleHandle('kernel32');
   IsVistaOrWin7 := GetProcAddress(hKernel32, 'GetLocaleInfoEx') <> nil;
.....
end;

Something else: that tvtunner has a program to view TV channels. In a window displays some informations about the currently viewed channel (for example the number). I know the handle of the window and I want to read these informations.
Is there a way?
Please help me...
Thank you in advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.