小弟想在服务中调用启动一个应用程序,用WinExec,ShellApi启动不了,不知为什么?大侠请指点。 用CreateProcess 不知行不行?
解决方案 »
- 请教cxgrid中粘贴怎么实现
- 我按照网上介绍对QuickReport进行了修改,做了自己的Preview界面,在SDI上可以通过,但在MDI却不行.错误...
- 如何比较dbgrid相应数据项,并将该单元变颜色
- $Description是什么啊?怎么用?小弟刚学!
- 请那一位大侠给一个关于api函数,参数,解释详细的说明文档!!
- 谁能提供DELPHI自带的DEMOS的所有例子的相关资料??
- 怎么样在win2000中注册win98自带的控件Comctl32.ocx
- 急,高薪聘兼职!!!找上海浦东(南浦大桥附近)delphi,VC程序员。
- 高分求解释,
- update 记录.db set 记录.db.备注=人走了 where 房间号=edit1.text 哪里错了????????????
- VCL用了这么久,却没想到被一个不是难题的难题难倒了。。。。
- dcom组件中如何实现一个返回自身接口集合的方法。
FileName: array [0..80] of char;
si : TStartupInfo;
pi : TProcessInformation;
Len :Integer;
hReg:HKEY;
Ret :integer;
begin
Ret := RegOpenKeyEx(HKEY_LOCAL_MACHINE, 'Software\xxx有限公司\Sample',
0, KEY_READ, hReg);
if Ret = ERROR_SUCCESS then
begin
Len := 80;
RegQueryValueEx(hReg, 'Path', nil, nil, @FileName, @Len);
RegCloseKey(hReg);
end; StrCat(FileName, 'Sample.exe');
ZeroMemory(@si, sizeof(TStartupInfo));
si.cb := sizeof(TStartupInfo);
si.dwFlags := si.dwFlags OR STARTF_USESHOWWINDOW;
si.wShowWindow := SW_SHOW;
ZeroMemory(@pi, sizeof(TProcessInformation));
CreateProcess(nil, // No module name (use command line).
FileName, // Command line.
nil, // Process handle not inheritable.
nil, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
nil, // Use parent's environment block.
nil, // Use parent's starting directory.
si, // Pointer to STARTUPINFO structure.
pi); // Pointer to PROCESS_INFORMATION structure. CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
Suspend;
end;win2000服务程序调试成功