A程序调用B程序 B程序如果返回一个值(1或者0)
A程序怎么检测这个值呢!小第写一个安装制作程序,设计到注册码的问题。
安装程序setupbulider.exe
注册码验证程序 project1.exe小第打算这样做在setupbulider.exe
带参调用project1.exe ->winexec(pchar('projec1.exe '+'注册码 '+' 验证码'),sw_hide)注册码验证程序启动后,立刻验证该注册码,如果通过返回1,没通过返回0
可是小第不知道如何返回(返回了setupbulider.exe又如何接收呢),查了好久sdk好象mpi可以用,但搞不清楚
!
A程序怎么检测这个值呢!小第写一个安装制作程序,设计到注册码的问题。
安装程序setupbulider.exe
注册码验证程序 project1.exe小第打算这样做在setupbulider.exe
带参调用project1.exe ->winexec(pchar('projec1.exe '+'注册码 '+' 验证码'),sw_hide)注册码验证程序启动后,立刻验证该注册码,如果通过返回1,没通过返回0
可是小第不知道如何返回(返回了setupbulider.exe又如何接收呢),查了好久sdk好象mpi可以用,但搞不清楚
!
解决方案 »
- 多线程将数据插入access,dbgrid来显示数据更新,但是出错!
- 怎样访问另一张表的备注型
- 学生专用工作搜索引擎,支持分组语音群聊
- 有没有程序代码可以实现Panton(潘通色卡)色号与RBG或者DELPHI中的16进制的颜色转换
- DELPHI的打印控制问题
- 我想在dbgrid中点某一行的某个字段出现一个下拉框,下拉框中的内容来自其它数据集中的数据。
- 在等待串口返回数据的过程中,同时响应其他交互操作?
- 会哪种语言或工具最容易找工作
- 关于注册表:如何得到一个主键内的所有信息?
- 把自己的Logo拿出来秀一秀
- 怎么将listbox和edit关联?
- 请问谁有真正的图片的翻页效果???或者水波效果~~~对处理图片有经验的进来~~!!
// AppName: name (including path) of the application
// AppArgs: command line arguments
// Wait: 0 = don't wait on application
// >0 = wait until application has finished (maximum in milliseconds)
// <0 = wait until application has started (maximum in milliseconds)
// Hide: True = application runs invisible in the background
// ExitCode: exitcode of the application (only avaiable if Wait <> 0)
//
function STO_ShellExecute(const AppName, AppArgs: String; const Wait: Integer;
const Hide: Boolean; var ExitCode: DWORD): Boolean;
var
myStartupInfo: TStartupInfo;
myProcessInfo: TProcessInformation;
sAppName: String;
iWaitRes: Integer;
begin
// initialize the startupinfo
FillChar(myStartupInfo, SizeOf(TStartupInfo), 0);
myStartupInfo.cb := Sizeof(TStartupInfo);
myStartupInfo.dwFlags := STARTF_USESHOWWINDOW;
if Hide then // hide application
myStartupInfo.wShowWindow := SW_HIDE
else // show application
myStartupInfo.wShowWindow := SW_SHOWNORMAL;
// prepare applicationname
sAppName := AppName;
if (Length(sAppName) > 0) and (sAppName[1] <> '"') then
sAppName := '"' + sAppName + '"';
// start process
ExitCode := 0;
Result := CreateProcess(nil, PChar(sAppName + ' ' + AppArgs), nil, nil, False,
NORMAL_PRIORITY_CLASS, nil, PChar(ExtractFilePath(AppName)),
myStartupInfo, myProcessInfo);
// could process be started ?
if Result then
begin
// wait on process ?
if (Wait <> 0) then
begin
if (Wait > 0) then // wait until process terminates
iWaitRes := WaitForSingleObject(myProcessInfo.hProcess, Wait)
else // wait until process has been started
iWaitRes := WaitForInputIdle(myProcessInfo.hProcess, Abs(Wait));
// timeout reached ?
if iWaitRes = WAIT_TIMEOUT then
begin
Result := False;
TerminateProcess(myProcessInfo.hProcess, 1);
end;
// getexitcode
GetExitCodeProcess(myProcessInfo.hProcess, ExitCode);
end;
CloseHandle(myProcessInfo.hProcess);
end;
end;
GetExitCode應該可返回你要的東西, 但你這樣很不安全, 我覺得, 人家要是替換你的
>>注册码验证程序 project1.exe
自己返回呢??
最好用共享全局內存變量
or 消息類傳剃
可以将注册文件做成DLL,当安装时调用该DLL的某个函数进行校验注册,这要安全很多。