如何让程序执行指定的程序?(0分)

J

jamers

Unregistered / Unconfirmed
GUEST, unregistred user!
又是个菜鸟级的问题,不要笑我,我不熟悉Delphi,呵,
如果哪位有函数全一点的函数、命令功能表的话,麻烦给我发一份!
因为我常问问题,所以没分了,见谅…
谢谢
jamers@sohu.com
 
用winexec,它的参数应该怎么写?
 
winexec(pchar('程序路径'),1);
 
var
strDir,strFile : string;
begin
GetDir(0,strDir);
{ 0 = 當前驅動器}
strFile := strDir+'//help//help.chm';
if FileExists(strFile) then
begin
try
ShellExecute(handle,nil,PChar(strFile),nil,nil,sw_shownormal);
finally
//
end;
end;
//end if
end;
 
另Winexec,还有ShellExecute及ShellExecuteEx,
Winexec只能执行可实行程序,而ShellExecute及ShellExecuteEx不但拥有Winexec的全部功能
还可以只给出程序名(不可执行的),由系统自动寻找打开该文件的可执行程序。
详见Win32 API帮助
 
tnks

测试通过…
 
顶部