Show system volume control

Posted in System

Use SNDVOL32.EXE program, which is contained in windows directory. Use ShellExecute for running this program. Don't forget to add ShellAPI in uses chapter.

uses ShellAPI;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  MyWin: array[0..255] of Char;
const
  Size: Integer = MAX_PATH;
begin
  GetWindowsDirectory(MyWin, Size);
  ShellExecute(
    Form1.Handle,
    'open',
    'sndvol32.exe',
    nil,
    MyWin,
    SW_SHOWNORMAL);
end;