使用IShellLink来创建快捷方式?下面是现成得代码:<br>procedure CreateLnk(sFileName, sLink:string; pchDes : LPSTR);<br>var<br> psl : IShellLink;<br> ppf: IPersistFile;<br> pchBuf : array[0..1024] of Char;<br> wch: array[0..1024] of WideChar;<br>begin<br> try<br> OleCheck(CoCreateInstance(CLSID_ShellLink, nil, LSCTX_INPROC_SERVER, IID_IShellLink, psl)); //Get the IShellLink Interface<br> <br> try<br> OleCheck(psl.QueryInterface(IID_IPersistFile, ppf)); //Get the IPersistFile Interface<br> OleCheck(psl.SetDescription(pchDes)); //LNK file's description<br> StrPCopy(pchBuf, sFileName); //Set the original file name<br> OleCheck(psl.SetPath(pchBuf));<br> StrPCopy(pchBuf, sLink);<br> MultiByteToWideChar(CP_ACP, 0, pchBuf, -1, wch, 1024);<br> OleCheck(ppf.Save(wch, True));<br> finally<br> ppf.Release;<br> end;<br> finally<br> psl.Release;<br> end;<br>end;<br>这个程序在结束时会产生一个异常,我还没有仔细检查,但是估计用接口的包装类(Wrapper Class)来代替接口本身会更好一些.