注册 登录
编程论坛 Delphi论坛

[求助]一个关于SHELLAPI函数的问题`知道的请进!

zrwl 发布于 2005-05-19 21:36, 1043 次点击
我想在Label控件中实现超连接,要用到shellexecute这个函数```但是我不知道

其语法格式`,哪位高手赐教?
4 回复
#2
ysp_19842006-01-14 04:09

体验一下ShellExecute的威力吧:

* 运行一个程序:
ShellExecute(Handle, 'open', PChar('c:\test\app.exe'), nil, nil, SW_SHOW);

* 运行记事本并打开一个文本文件 (系统知道记事本程序的位置,所以我们不必给出完整路径):
ShellExecute(Handle, 'open', PChar('notepad'), PChar('c:\test\readme.txt'), nil, SW_SHOW);

* 打印一个文档:
ShellExecute(Handle, 'print', PChar('c:\test\test.doc'), nil, nil, SW_SHOW);

* 打开一个HTML网页,本地的或远程的:
ShellExecute(Handle, 'open', PChar('http://www.festra.com/'), nil, nil, SW_SHOW);

* 打开一个文本文件:
ShellExecute(Handle, 'open', PChar('c:\test\readme.txt'), nil, nil, SW_SHOW);
打开HTML帮助文件: ShellExecute(Handle, 'open', PChar('c:\windows\help\calc.chm'), nil, nil, SW_SHOW);

* 浏览文件夹:
ShellExecute(Handle, 'explore', PChar('c:\windows)', nil, nil, SW_SHOW);

* 运行DOS命令并立即返回:
ShellExecute(Handle, 'open', PChar('command.com'), PChar('/c copy file1.txt file2.txt'), nil, SW_SHOW);

* 运行DOS命令,保持DOS窗口是开着的:
ShellExecute(Handle, 'open', PChar('command.com'), PChar('/k dir'), nil, SW_SHOW);

#3
zhlfdm2006-01-14 08:45

应该多介绍介绍此类的函数

#4
斯文的√流氓2006-01-23 04:27
我用你的语句怎么不能运行啊?

斑竹看见了请给我讲解一下可以吗 我也是初学呀!

可以发到我QQ上吗?

188257253
#5
trance1102006-02-14 16:59

在LABEL里的超级连接

user shellapi

ShellExecute(0,nil,'http://www.xxx.com',nil,nil,SW_NORMAL)

1