function CrnModifyShortcutArguments(strLnkFile:String;strArguments:String):boolean; var wszBuf:array [0..MAX_PATH] of widechar; szBuf :array [0..MAX_PATH] of char; bResult: boolean; pShellLink:^IShellLink; ppf :^IPersistFile; begin if not FileExists(strLnkFile) then begin MessageBox(0, '指定的快捷方式未找到!', '错误', MB_OK or MB_ICONERROR); result:= False; end; //WideChar(wszBuf,MAX_PATH); bResult:= (CoInitialize(nil)=S_OK); //@1 if (bResult) then begin bResult:= Boolean(CoCreateInstance(CLSID_ShellLink,nil,CLSCTX_INPROC_SERVER,IShellLink,pointer(pShellLink)) >= 0); //*@2 if(bResult) then begin bResult:= pshellLink^.QueryInterface(IShellLink,pointer(PPF))>= 0; //*@3 if (bResult) then begin bResult:= ppf^.Load(wszBuf, 0) >= 0; //*@4 if (bResult) then begin pShellLink^.SetArguments(pchar(strArguments)); bResult:= ppf^.Save(wszBuf, TRUE) >= 0; end; ppf^._Release(); end; pShellLink^._Release(); end; CoUninitialize(); end; result:= bResult;