Products

Price/Order

Support

Partners

Testimonials

Test Results

About us

Contact
 Remove the DING sound when using a TListView on VISTA
Bottom
 
Total posts: 1
 Author Remove the DING sound when using a TListView on VISTA
Danijel Tkalcec [RTC]

12.05.2009 09:05:09
Registered user
If you and/or your users are working on Vista and are annoyed by the "Ding" sound when using a TListView component (selecting items with mouse or keyboard), you might find this function useful:
procedure EliminateListViewBeep;
  var
    reg:TRegistry;
  begin
  reg:=TRegistry.Create;
  try
    reg.RootKey:=HKEY_CURRENT_USER;
    if reg.OpenKey('\AppEvents\Schemes\Apps\.Default\CCSelect\.current',False) then
    try
      if reg.ValueExists('') then
        if Trim(reg.ReadString(''))='' then
          reg.DeleteValue('');
    finally
      reg.CloseKey;
      end;
    if reg.OpenKey('\AppEvents\Schemes\Apps\.Default\CCSelect\.Modified',False) then
    try
      if reg.ValueExists('') then
        if Trim(reg.ReadString(''))='' then
          reg.DeleteValue('');
    finally
      reg.CloseKey;
      end;
  finally
    reg.Free;
    end;
  end;
If the user has not explicitly set a sound, the default value set by Microsoft is a space character, which produces that annoying DING sound when you do something with a List View. To eliminate this, we have to delete the value. Note that the above code will NOT touch the value unless it is set to an "empty string", which means that users settings will not be modified if he wants to hear a sound.

PS. Since all RTC Portal projects are using a List View to display some things, I will be adding this code to RTC Host, Viewer and Control projects "OnFormCreate" events in the next update.

Best Regards,
Danijel Tkalcec