有三种方法:(以Notepad.exe为例)
1.Shell方法:ShellExecute(hwnd,"open","C:\\windows\\notepad.exe","",
NULL,SW_SHOWNORMAL)2.Winexec方法:
WinExec("C:\\windows\\notepad.exe",SW_SHOW)3.建立线程方法:
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
memset(&StartupInfo, 0, sizeof(STARTUPINFO));
StartupInfo.cb=sizeof(STARTUPINFO);
if(!CreateProcess(NULL,
"C:\\windows\\notepad.exe",
NULL,
NULL,
false,
NORMAL_PRIORITY_CLASS,
NULL,
"",
&StartupInfo,
&ProcessInformation)
1.Shell方法:ShellExecute(hwnd,"open","C:\\windows\\notepad.exe","",
NULL,SW_SHOWNORMAL)2.Winexec方法:
WinExec("C:\\windows\\notepad.exe",SW_SHOW)3.建立线程方法:
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
memset(&StartupInfo, 0, sizeof(STARTUPINFO));
StartupInfo.cb=sizeof(STARTUPINFO);
if(!CreateProcess(NULL,
"C:\\windows\\notepad.exe",
NULL,
NULL,
false,
NORMAL_PRIORITY_CLASS,
NULL,
"",
&StartupInfo,
&ProcessInformation)
解决方案 »
- 请问各位这是什么控件啊!
- 我用IdHTTP1.get读取一个网页内容,可是不久就停止不动了,怎么解决啊?
- 请问这个IP是哪里的? 219.130.108.117
- 用windowmediaplay控件怎样控制播放的速度??<不是delphi自带的Tmediaplayer控件>
- 60分请教,怎么取出Adoquery
- 如何查找数据库?
- 关于Delphi5与Sql Server2000兼容问题?
- 想把一幅图片用绘图的方法在image上显示出来,请大虾赐教!!
- 在DELPHI中怎么用SQL的MAX,COUNT 等函数
- 有关speetbution按钮加入图片问题
- delphi 里 用DBGRID显示数据问题
- 谁有软件开发文档编制的范例呀?
做简单的方法是:
复制BCB文件夹下BDE文件夹(当然只有部分有用,如果你不是很了解BDE,干脆整个文件夹),然后设置注册表两种方法:
1。手动(内容参下)
2。编程动态实现:
TRegistry *cReg=new TRegistry;
cReg->RootKey=HKEY_LOCAL_MACHINE;
cReg->OpenKey("Software\\Borland\\BLW32",true);
String path=GetCurrentDir(); String BDEpath=path+"\\BDE";
cReg->WriteString("BLAPIPATH",BDEpath);
cReg->CloseKey(); cReg->OpenKey("Software\\Borland\\Database Engine",true); cReg->WriteString("DLLPATH",BDEpath);
cReg->WriteString("CONFIGFILE01",BDEpath+"\\IDAPI.CFG");
cReg->CloseKey();
delete cReg;
HINSTANCE ShellExecute( HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
);