running applications from delphitm: using shellexecute (part 1)
【相关文章:[原创]彻底解决Struts分页显示】level: newbie-hacker 【扩展阅读:Linux学习笔记-shell命令[转帖】 【扩展信息:PHP 和Apache 结合重写URL以】author: the bakerdate: 2002-04-19
running or opening external programs or files, from delphitm applications, is often a necessary requirement. this article covers the shellexecute windows api function, revealing techniques for running external applications from your delphi applications.
running applications from delphi
there are a number of reasons why you might be interested in running external applications from your delphi application. often programs are segmented into a number of logical divisions to represent different components of a larger system. some sub-system components might include:
main application
setup/installer application
system application (specifying system wide options)
application server application
reporting application
an external third party application
as can be seen, there are a number of reasons why you might need to call an external application. let´s discuss how we can do this with the shellexecute command.
shellexecute winapi
the shellexecute api allows for the execution (or "running") of external applications. it also has a number of other uses, however these all involve performing operations on external files. the syntax for the shellexecute winapi function is:
hinstance shellexecute(hwnd hwnd,
lpctstr lpoperation, ... 下一页