riteBool(RunGateSectionName, 'GetStart1', g_Config.RunGate.GetStart[0]);
g_IniConf.WriteBool(RunGateSectionName, 'GetStart2', g_Config.RunGate.GetStart[1]);
g_IniConf.WriteBool(RunGateSectionName, 'GetStart3', g_Config.RunGate.GetStart[2]);
g_IniConf.WriteBool(RunGateSectionName, 'GetStart4', g_Config.RunGate.GetStart[3]);
g_IniConf.WriteBool(RunGateSectionName, 'GetStart5', g_Config.RunGate.GetStart[4]);
g_IniConf.WriteBool(RunGateSectionName, 'GetStart6', g_Config.RunGate.GetStart[5]);
g_IniConf.WriteBool(RunGateSectionName, 'GetStart7', g_Config.RunGate.GetStart[6]);
g_IniConf.WriteBool(RunGateSectionName, 'GetStart8', g_Config.RunGate.GetStart[7]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort1', g_Config.RunGate.GatePort[0]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort2', g_Config.RunGate.GatePort[1]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort3', g_Config.RunGate.GatePort[2]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort4', g_Config.RunGate.GatePort[3]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort5', g_Config.RunGate.GatePort[4]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort6', g_Config.RunGate.GatePort[5]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort7', g_Config.RunGate.GatePort[6]);
g_IniConf.WriteInteger(RunGateSectionName, 'GatePort8', g_Config.RunGate.GatePort[7]);
g_IniConf.WriteInteger(SelGateSectionName, 'MainFormX', g_Config.SelGate.MainFormX);
g_IniConf.WriteInteger(SelGateSectionName, 'MainFormY', g_Config.SelGate.MainFormY);
g_IniConf.WriteInteger(SelGateSectionName, 'GatePort1', g_Config.SelGate.GatePort[0]);
g_IniConf.WriteInteger(SelGateSectionName, 'GatePort2', g_Config.SelGate.GatePort[1]);
g_IniConf.WriteBool(SelGateSectionName, 'GetStart1', g_Config.SelGate.GetStart1);
g_IniConf.WriteBool(SelGateSectionName, 'GetStart2', g_Config.SelGate.GetStart2);
g_IniConf.WriteInteger(LoginGateSectionName, 'MainFormX', g_Config.LoginGate.MainFormX);
g_IniConf.WriteInteger(LoginGateSectionName, 'MainFormY', g_Config.LoginGate.MainFormY);
g_IniConf.WriteInteger(LoginGateSectionName, 'GatePort', g_Config.LoginGate.GatePort);
g_IniConf.WriteBool(LoginGateSectionName, 'GetStart', g_Config.LoginGate.GetStart);
g_IniConf.WriteInteger(PlugTopSectionName, 'MainFormX', g_Config.PlugTop.MainFormX);
g_IniConf.WriteInteger(PlugTopSectionName, 'MainFormY', g_Config.PlugTop.MainFormY);
g_IniConf.WriteBool(PlugTopSectionName, 'GetStart', g_Config.PlugTop.GetStart);
end;
{启动服务,用的大部分是API}
function RunProgram(var ProgramInfo: TProgram; sHandle: string; dwWaitTime: LongWord): LongWord;
var
StartupInfo: TStartupInfo; //获取窗口状态
sCommandLine: string; //程序完整路径
sCurDirectory: string; //程序目录
begin
Result := 0;
FillChar(StartupInfo, SizeOf(TStartupInfo), #0); //这个虽然查看了API参考,还是不理解,暂时就认为它是初始化吧
GetStartupInfo(StartupInfo);//获取进程的启动信息
{格式化程序完整路径字符串}
sCommandLine := format('%s%s %s %d %d', [ProgramInfo.sDirectory, ProgramInfo.sProgramFile, sHandle, ProgramInfo.nMainFormX, ProgramInfo.nMainFormY]);
sCurDirectory := ProgramInfo.sDirectory; //取得程序运行目 |