如何在桌面创建快捷方式
解决方案 »
- 怎么获得表结构
- 我应该把这段判断是否连接到数据库服务器上的代码写在什么事件里呢???24H结贴!!!
- 我的Delphi6找不到TDataSetProvider等多层开发的组件?
- 虚拟方法问题
- 50分求解:如何在运行时拖动RichEdit控件和Image控件?
- 怎么把值写到Tvaluelisteditor的第n行的value列里面啊?
- SendMessage的问题..有答案立马给100分.
- 请问各位大侠哪里有把数据库文件转换成WORD文件的软件?
- MDIForm adn Parent and MdiChild的错误?
- 类的引用
- message窗口没了,很痛苦!
- 请问:在不关闭窗体的情况下怎么让某个菜单的快捷键失效??先谢了
uses ComObj, ShlObj, ActiveX;
Function CreateShortCutLink(Fname, LArguments, LinkPath, LDescription,StartDir, LinkIcon: string): HRESULT;var IU: IUnknown; ILink: IShellLink; IPF: IPersistFile; Buffer: array [0..MAX_PATH - 1] of Word;begin IU := CreateComObject(CLSID_ShellLink); ILink := IU as IShellLink; IPF := IU as IPersistFile; ILink.SetArguments(PChar(LArguments)); ILink.SetPath(PChar(Fname)); ILink.SetDescription(PChar(LDescription)); ILink.SetIconLocation(PChar(LinkIcon), 0); ILink.SetWorkingDirectory(Pchar(StartDir)); MultiByteToWideChar(CP_ACP, 0, PChar(LinkPath), -1, @Buffer, MAX_PATH); Result := IPF.Save(@Buffer, False);end;
示例:
CreateShortCutLink(application.exename,'/ns','C:\windows\desktop\application.lnk','My application',application.exename); * - This creates a shortcut named "Application.lnk" on the desktop with command line argumnets of "/ns" and the