我为某些文件类型设置了属性处理程序扩展(类似于“标题”属性列)但是当我想为avi或3gp扩展名这样的真实类型注册Shell扩展时不会工作但是像avi1或3gp1这样的其他类型就像魅力一样。
我搜索regisrery并为avi和avi1添加了PropertyHandler,但是为avi找到了一个名为“HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ PropertySystem \ SystemPropertyHandlers”的密钥,其中包含3gp和avi的值,它的值与我的处理程序不同无法更改或删除此值。
我想问一下如何在SystemPropertyHandlers中更改这些类型属性处理程序?例如,为avi文件添加Title属性。
修改
这是帮助解决问题的代码:
type
TPropertyStoreExtension6 = class(TdecShellPropertyStoreExtension)
protected
class function GetClassID: TCLSID; override;
class function GetDescription: UnicodeString; override;
procedure FillProgIDList(AList: TStrings); override;
procedure Clear; override;
function GetPropertyCount: Integer; override;
function GetPropertyKey(AIndex: Integer): TPropertyKey; override;
function GetPropertyName(AIndex: Integer): UnicodeString; override;
procedure LoadDataFromFile(const AFileName: UnicodeString;
AOpenMode: DWORD); override;
procedure LoadDataFromFolder(const AFolderName: UnicodeString); override;
function GetAvailablePropertyCount: Integer; override;
function AvailableIndexToIndex(AIndex: Integer): Integer; override;
function GetPropertyValue(AIndex: Integer): OleVariant; override;
procedure CommitToFile(const AFileName: UnicodeString;
AOpenMode: DWORD); override;
private
Filename: UnicodeString;
end;
implementation
uses SysUtils, Variants;
class function TPropertyStoreExtension6.GetClassID: TCLSID;
begin
Result := SID_TPropertyStoreExtension6;
end;
class function TPropertyStoreExtension6.GetDescription: UnicodeString;
begin
Result := 'Your handler description';
end;
procedure TPropertyStoreExtension6.FillProgIDList(AList: TStrings);
begin
AList.Add(UnicodeStringToString('.avi'));
AList.Add(UnicodeStringToString('.avi1'));
end;
procedure TPropertyStoreExtension6.Clear;
begin
inherited Clear;
end;
function TPropertyStoreExtension6.GetPropertyCount: Integer;
begin
Result := 3;
end;
function TPropertyStoreExtension6.GetPropertyKey(AIndex: Integer): TPropertyKey;
begin
ZeroMemory(@Result, SizeOf(Result));
case AIndex of
0:
Result := PKEY_Title;
end;
end;
function TPropertyStoreExtension6.GetPropertyName(AIndex: Integer)
: UnicodeString;
begin
Result := '';
case AIndex of
0:
Result := 'Title';
end;
end;
procedure TPropertyStoreExtension6.LoadDataFromFile(const AFileName
: UnicodeString; AOpenMode: DWORD);
begin
end;
procedure TPropertyStoreExtension6.LoadDataFromFolder(const AFolderName
: UnicodeString);
begin
end;
function TPropertyStoreExtension6.GetAvailablePropertyCount: Integer;
begin
Result := 1
end;
function TPropertyStoreExtension6.AvailableIndexToIndex
(AIndex: Integer): Integer;
begin
Result := AIndex
end;
function TPropertyStoreExtension6.GetPropertyValue(AIndex: Integer): OleVariant;
begin
case AIndex of
0:
Result := 'Title is here';
end;
end;
procedure TPropertyStoreExtension6.CommitToFile(const AFileName: UnicodeString;
AOpenMode: DWORD);
begin
end;
initialization
TPropertyStoreExtension6.Register;
end.
编辑:
我只是测试this方式但发生了这个错误:
无法在SystemPropertyHandlers上保存权限更改。
编辑:
我更改here之类的权限并更改键值但仍然我的属性处理程序不适用于avi。
编辑:
我从