ShellExecute(Application.Handle, nil, 'C:\WINDOWS\CALC.EXE'+#0, nil, nil, SW_SHOWNORMAL)//启动自动关联程序ShellExecute(Application.Handle, nil, 'www.csdn.net'+#0, nil, nil, SW_SHOWNORMAL)//启动自动关联程序
调试欢乐多
uses shellapi;
Forms,
Unit1 in 'Unit1.pas' {Form1};begin
Application.Initialize; // <------This
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
你把我给的那句程序直接用就ok了!记得uses shellapi;
ShellExecute(Handle, nil, 'C:\WINDOWS\notepad', 'c:\autoexec.bat', nil, SW_SHOWNORMAL);
用法就自已去杳帮助!!
用shellexecute就行了
ShellExecute(0, nil, 'html file', '', nil, SW_SHOWNORMAL);都可以的,注意要 uses ShellApi 的。
shellexectue(handle,open,'*.htm','','',sw_shownormal);
引用fmxutils.pas单元(Delphi自己的)
调用ExecuteFile(...)
人家已经帮我们把ShellExecute封装好了!