当前位置:首页 > 网络编程 > 软件语言 > DELPHI > 用Delphi创建Internet快捷方式

用Delphi创建Internet快捷方式

点击次数:44 次 发布日期:2008-11-09 08:39:06 作者:源代码网
源代码网推荐
广告载入中
在Windows中,为了方便文件或者文件夹的访问,我们常常为某些文件或者文件夹建立快捷方式(shortcut)。同样,在Internet Explorer中,我们也可以为自己喜爱的网址建立Internet快捷方式(Internet Shortcut)。只要点击快捷方式,Internet Explorer就会启动,并联接到相应的网站。事实上,除了Internet Explorer可以创建Internet快捷方式之外,在我们的应用程序中也同样可以实现此功能。在本文中,我将要向读者介绍如何在Delphi程序中为网址建立Internet快捷方式。
源代码网推荐
源代码网推荐
源代码网推荐 Internet快捷方式的格式
源代码网推荐
源代码网推荐
源代码网推荐 为了分析Internet快捷方式的文件格式,我们可以先用Internet Explorer为某个网址建立一个快捷方式,然后在DOS窗口中用DIR命令找到Internet快捷方式所对应的文件,并且用edit查看文件的内容。不难发现,Internet快捷方式的文件格式与INI文件的格式是一样的,只不过它的扩展名必须是 .URL罢了。 Internet快捷方式的文件格式如下:
源代码网推荐
源代码网推荐
源代码网推荐 [DEFAULT]
源代码网推荐
源代码网推荐 BASEURL=
源代码网推荐
源代码网推荐
源代码网推荐 [InternetShortcut]
源代码网推荐
源代码网推荐 URL=
源代码网推荐
源代码网推荐 WorkingDirectory=
源代码网推荐
源代码网推荐 ShowCommand=
源代码网推荐
源代码网推荐 IconIndex=
源代码网推荐
源代码网推荐 IconFile=
源代码网推荐
源代码网推荐 Modified=
源代码网推荐
源代码网推荐 HotKey=
源代码网推荐
源代码网推荐 其中BASEURL、URL和WorkingDirectory这3项的含义是不言而明的。ShowCommand规定Internet Explorer启动后窗口的初始状态:7表示最小化,3表示最大化;如果没有ShowCommand这一项的话则表示正常大小。IconFile和IconIndex用来为Internet快捷方式指定图标;如果你不想指定图标,Windows会使用缺省的Internet快捷方式图标。HotKey指定一个整数值;HotKey的值及其含义如下:
源代码网推荐
源代码网推荐
源代码网推荐 833 - Ctrl Shift A
源代码网推荐
源代码网推荐 834 - Ctrl Shift B
源代码网推荐
源代码网推荐 835 - Ctrl Shift C
源代码网推荐
源代码网推荐 836 - Ctrl Shift D
源代码网推荐
源代码网推荐 837 - Ctrl Shift E
源代码网推荐
源代码网推荐 838 - Ctrl Shift F
源代码网推荐
源代码网推荐
源代码网推荐
源代码网推荐 1601 - Ctrl Alt A
源代码网推荐
源代码网推荐 1602 - Ctrl Alt B
源代码网推荐
源代码网推荐 1603 - Ctrl Alt C
源代码网推荐
源代码网推荐 1604 - Ctrl Alt D
源代码网推荐
源代码网推荐 1605 - Ctrl Alt E
源代码网推荐
源代码网推荐 1606 - Ctrl Alt F
源代码网推荐
源代码网推荐 ...
源代码网推荐
源代码网推荐
源代码网推荐 一个简单的Internet快捷方式只需要在
源代码网推荐
源代码网推荐 [InternetShortcut]节中包含URL项就可以了,例:
源代码网推荐
源代码网推荐 [InternetShortcut]
源代码网推荐
源代码网推荐 URL=http://www.yahoo.com
源代码网推荐
源代码网推荐 快捷方式的创建
源代码网推荐
源代码网推荐
源代码网推荐 接下来,我们来看一个非常简单的Delphi例子。此程序将在Windows的桌面上建一个一个名为“计算机世界”的快捷方式,它指向《计算机世界》的首页;快捷方式的图标使用Windows 98/95中System目录(或者Windows NT中的System32目录)下的shell32.dll动态联接库中的第41号图标。


源代码网推荐
源代码网推荐
源代码网推荐 由于Internet快捷方式的文件格式与INI文件的是相同的,我们可以使用Delphi的TiniFile类来读写.URL文件的内容。而要使快捷方式出现在桌面上,我们只要把.URL文件保存在Windows桌面所对应的那个目录之下即可。当前用户的桌面目录可以从注册表中获取,此信息保存在Windows注册表HKEY_CURRENT_USER 根键下的SoftwareMicrosoftWindows
源代码网推荐
源代码网推荐 CurrentVersionExplorerShell Folders主键的Desktop项中。
源代码网推荐
源代码网推荐
源代码网推荐 示例程序的单元文件的代码如下:
源代码网推荐
源代码网推荐
源代码网推荐 unit Unit1;
源代码网推荐
源代码网推荐
源代码网推荐 interface
源代码网推荐
源代码网推荐
源代码网推荐 uses
源代码网推荐
源代码网推荐 Windows
源代码网推荐
源代码网推荐 Messages
源代码网推荐
源代码网推荐 SysUtils
源代码网推荐
源代码网推荐 Classes
源代码网推荐
源代码网推荐
源代码网推荐 Graphics
源代码网推荐
源代码网推荐 Controls
源代码网推荐
源代码网推荐 Forms
源代码网推荐
源代码网推荐 Dialogs
源代码网推荐
源代码网推荐 7
源代码网推荐
源代码网推荐 StdCtrls
源代码网推荐
源代码网推荐 Registry
源代码网推荐
源代码网推荐 IniFiles;
源代码网推荐
源代码网推荐
源代码网推荐 type
源代码网推荐
源代码网推荐 TForm1 = class(TForm)
源代码网推荐
源代码网推荐 Button1: TButton;
源代码网推荐
源代码网推荐 procedure Button1Click(Sender: TObject);
源代码网推荐
源代码网推荐 private
源代码网推荐
源代码网推荐 { Private declarations }
源代码网推荐
源代码网推荐 public
源代码网推荐
源代码网推荐 { Public declarations }
源代码网推荐
源代码网推荐 end;
源代码网推荐
源代码网推荐
源代码网推荐 var
源代码网推荐
源代码网推荐 Form1: TForm1;
源代码网推荐
源代码网推荐
源代码网推荐 implementation
源代码网推荐

源代码网推荐
源代码网推荐 {$R *.DFM}
源代码网推荐
源代码网推荐
源代码网推荐 procedure TForm1.Button1Click(Sender: TObject);
源代码网推荐
源代码网推荐 var
源代码网推荐
源代码网推荐 ini:TIniFile;
源代码网推荐
源代码网推荐 Reg:TRegistry;
源代码网推荐
源代码网推荐 DesktopPath
源代码网推荐
源代码网推荐 FileName
源代码网推荐
源代码网推荐 S:String;
源代码网推荐
源代码网推荐 Buf:array[0..max_path]of char;
源代码网推荐
源代码网推荐 begin
源代码网推荐
源代码网推荐
源代码网推荐 //获取当前用户Desktop文件夹的路径
源代码网推荐
源代码网推荐 Reg:=TRegistry.Create;
源代码网推荐
源代码网推荐 Reg.RootKey:=HKEY_CURRENT_USER;
源代码网推荐
源代码网推荐 try
源代码网推荐
源代码网推荐 Reg.OpenKey("SoftwareMicrosoftWindows
源代码网推荐
源代码网推荐 CurrentVersionExplorerShell Folders"
源代码网推荐
源代码网推荐 False);
源代码网推荐
源代码网推荐 if Reg.ValueExists("Desktop") then
源代码网推荐
源代码网推荐 DesktopPath:=Reg.ReadString("Desktop");
源代码网推荐
源代码网推荐 finally
源代码网推荐
源代码网推荐 Reg.Free;
源代码网推荐
源代码网推荐 end;
源代码网推荐
源代码网推荐 if (DesktopPath< >"")and(DesktopPath
源代码网推荐
源代码网推荐 [Length(DesktopPath)]< >"")
源代码网推荐
源代码网推荐 then DesktopPath:=DesktopPath "";
源代码网推荐
源代码网推荐
源代码网推荐 //将Buf清零
源代码网推荐
源代码网推荐 FillChar(Buf
源代码网推荐
源代码网推荐 SizeOf(Buf)
源代码网推荐
源代码网推荐 0);
源代码网推荐
源代码网推荐 //获取Win98/95中的System
源代码网推荐
源代码网推荐 文件夹或者NT中的System32文件夹的路径
源代码网推荐
源代码网推荐 GetSystemDirectory(Buf
源代码网推荐
源代码网推荐 SizeOf(Buf));
源代码网推荐
源代码网推荐 S:=Buf;
源代码网推荐
源代码网推荐 if (S< >"")and(S[Length(S)]< >"") then S:=S "";
源代码网推荐
源代码网推荐 S:=S "shell32.dll";
源代码网推荐
源代码网推荐
源代码网推荐 //Internet快捷方式的文件名(扩展名必须是URL)
源代码网推荐
源代码网推荐 FileName:=DesktopPath "计算机世界.url";
源代码网推荐
源代码网推荐 ini:=TIniFile.Create(FileName);
源代码网推荐
源代码网推荐 //指定URL
源代码网推荐
源代码网推荐 ini.WriteString("InternetShortcut"
源代码网推荐
源代码网推荐 "URL"
源代码网推荐
源代码网推荐
源代码网推荐 "http://www.computerworld.com.cn");
源代码网推荐
源代码网推荐 //指定图标文件
源代码网推荐
源代码网推荐 ini.WriteString("InternetShortcut"
源代码网推荐
源代码网推荐 "IconFile"
源代码网推荐
源代码网推荐 S);
源代码网推荐
源代码网推荐 ini.WriteString("InternetShortcut"
源代码网推荐
源代码网推荐 "IconIndex"
源代码网推荐
源代码网推荐 "41");
源代码网推荐
源代码网推荐 ini.Free;
源代码网推荐
源代码网推荐 end;
源代码网推荐
源代码网推荐
源代码网推荐 end.


源代码网推荐

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华