在该程序的事件onactive/onshow/oncreate里面启动就可以拉??
procedure TForm1.Oncreate(Sender : TObject);
begin
shellexecute( );
end;
procedure TForm1.Oncreate(Sender : TObject);
begin
shellexecute( );
end;
解决方案 »
- 原来是李维的东西,大家看看,有个PicStack 实例...
- 这个控件是用delphi哪个版本做的
- 难题:不用MDI方式,如何能让背景窗体总是在最底(不能把其他窗体设为总在最前来解决)
- 怎么捕获的异常代码并处理掉?
- 请给以下DELPHI代码意见
- 急求quick report362版,有的请与我联系或是发到我信箱里。
- 一段时间应该设计为什么内型的字段???
- 为什么我用TInternetExplorer响应BeforeNavigate时不能Cancel
- 如何知道线程结束了?
- 如何在DELPHI中加超文本联接。
- 怎样使TOpenPictureDialog支持jpg啊?我搜索到两个帖子,却看不了。[在线等待中]
- 急!!!服务器上面的数据下载下来以后,在客户端以怎样的形式存储
可以参考一下API函数FindWindow。
用病毒的做法!
把EXE文件关联到你的程序文件!
在你的程序中用Paramstr(1)获得要执行的文件名!
然后在你的程序中启动Paramstr(1)!注册表地址:HKEY_CLASSES_ROOT\exefile\shell\open\command
对,是要用注册表
在win2000环境下为什么Paramstr(1)无值?
我在98下成功了.
还有winexec('fdsaf',9)的参数是什么意思?能解释一下吗?
或是
Shellexecute(handle
'open'
'notepad.exe'
''
nil
sw_shownormal);
以下是一个例子:
var
MyHandle: THandle;
MyStartupInfo: TStartupInfo;
MyProcessInfo: TProcessInformation;procedure TMyForm.ExecuteApp(MyPath: String);
begin
FillChar(MyStartupInfo, SizeOf(MyStartupInfo), 0);
//清除MyStartupInfo中的数据MyStartupInfo.cb:=SizeOf(MyStartupInfo);CreateProcess(PChar(MyPath), nil, nil, nil, False,
DETACHED_PROCESS, nil, nil, MyStartupInfo,
MyProcessInfo);MyHandle:=MyProcessInfo.hProcess;
//把执行的程序的句柄赋值给MyHandle,它会在终止程序时用到
end;procedure TMyForm.CloseApp(MyHandle: THandle);
begin
TerminateProcess(MyHandle, 0);
end;