用外壳扩展改文件名

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject); var
P : PWideChar;
NewPIDL, RenPIDL, PathPIDL: PItemIDList;
Flags,NumChars : LongWord;
//Index: Integer;
NewShellFolder : IShellFolder;
Value, PathValue : string;
begin
SHGetDesktopFolder(FIDesktopFolder);
Value := 'hubdog.txt';
PathValue := 'C:/';
NumChars := Length(PathValue);
Flags := 0;
P := StringToOleStr(PathValue);
OLECheck(FIDesktopFolder.ParseDisplayName(Application.Handle,nil,P,NumChars,PathPIDL,Flags));
OLECheck(FIDesktopFolder.BindToObject(PathPIDL,nil,IID_IShellFolder,Pointer(NewShellFolder)));
NumChars := Length(Value);
Flags := 0;
P := StringToOleStr(Value);
OLECheck(NewShellFolder.ParseDisplayName( Application.Handle,nil,P,NumChars,NewPIDL,Flags));
if NewShellFolder.SetNameOf(Application.Handle,NewPIDL,StringToOleStr('newhubdog.txt'),128,
 
后退
顶部