shellExecute(Application.Hande,nil,'c:\windows\system\msconfig.exe'+#0,
nil,nil,sw_shownormal)uses shellapi
nil,nil,sw_shownormal)uses shellapi
解决方案 »
- 散分了,祝大家圣诞快乐!
- 动态创建窗口
- 〔高分请教〕delphi2006导入第三方库的时候出错,delphi7无错
- 大虾:MDI窗体上有些按钮,当子窗体产生时候,没有盖住这些按钮,怎么处理是好?明天交货啊。。。
- 如何配置delphi进行com组件的编译,急急急!!!
- 给大家一个小说网站看看啊www.cnbooker.com
- 一个小问题,可能有点难
- 谁用过wwdbgrid,请教一个字段的掩码设置!
- Excel200工坐表中有几个checkbox,如何用delphi控制他们的状态。
- Delphi6 不能用 vararrayof 吗?D5可以呀
- 高分低难度问题,先来先得:怎么使用BlockWrite()这个函数?
- 我要在query控件代码中实现对sql表中地4条记录进行查阅,怎样写这条语句?
shellExecute()
都可以
Winexec('Notepad.exe help.txt',sw_Normal);
shellexecute 针对 windows中的所有文件 他会找到windows登记了的对应程序打开对应文件
ShellExecute(0, 'open', 'dd.txt', nil, nil, SW_SHOW);
procedure TForm1.Button1Click(Sender: TObject);
var
sCommandLine: string;
bCreateProcess: boolean;
lpStartupInfo: TStartupInfo;
lpProcessInformation: TProcessInformation;
begin
sCommandLine := 'D:\TEMP\TEST.EXE';
FillChar(lpStartupInfo, Sizeof(TStartupInfo), #0);
lpStartupInfo.cb := Sizeof(TStartupInfo);
lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;
lpStartupInfo.wShowWindow := SW_NORMAL; bCreateProcess := CreateProcess(nil, PChar(sCommandLine),
nil, nil, True, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
nil, nil, lpStartupInfo, lpProcessInformation);
end; |
|
LPCTSTR (C),工作目录
还有就是ShellExecute是打开或打印所有文件的,如果那个文件是可执行文件就运行那个程序,而CreateProcess 就纯粹是运行一个应用程序了。