Public feed #726167

Unnamed

public text v1 · immutable
Raw Edit
·published 2007-10-04 22:44 UTC
rendered paste body
  if RegGetValueNames(HKLM, PlayerExts + 'Types', WMPNum) then
    for I := 0 to GetArrayLength(WMPNum)-1 do
    begin
      if RegQueryStringValue(HKLM, PlayerExts + 'Types', WMPNum[I], WMPExt) and (WMPExt <> '')
      begin
        Ext := ';' + Ext + ';';
        WMPExt := ';' + WMPExt + ';';
        P := Pos(Ext, Lowercase(WMPExt));
        if P > 0 then
        begin
          WMPCount := WMPCount - Length(WMPExt) + 1;

          while P > 0 do
          begin
            Delete(WMPExt,P,Length(Ext) - 1);
            P := Pos(Ext, Lowercase(WMPExt));
          end;

          while (Length(WMPExt) > 0) and (WMPExt[1] = ';') do
            Delete(WMPExt,1,1);

          while (Length(WMPExt) > 0) and (WMPExt[Length(WMPExt)] = ';') do
            Delete(WMPExt,Length(WMPExt),1);

          if (WMPExt <> '') then
            if RegDeleteValue(HKLM, PlayerExts + 'Types', WMPNum[I]) then
            begin
              RegDeleteValue(HKLM, PlayerExts + 'Descriptions', WMPNum[I]);
              RegDeleteValue(HKLM, PlayerExts + 'MUIDescriptions', WMPNum[I]);
            end
          else begin
            RegWriteStringValue(HKLM, PlayerExts + 'Types', WMPNum[I], WMPExt);
            WMPCount := WMPCount + Length(WMPExt) + 1;
          end;
        end;
      end;
    end;