高手们快来看看!!!!高分奉送 winexec("",wm_hide);shellexecute();createprocess();设置使传口最小化或隐藏。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用winexec("",wm_hide)不行的,你需要用CreateProcess创建进程才可以。 To:FireAngel我之前写过一个程序,是批量调用批处理的。用winexec可以啊。不过就是得不到它的processID而已。试试如下的程序?procedure TmainForm.BatchItem(i:integer);var sCommandLine,strFJDM,strPath:string; configFile:Tinifile; y,m,d:word;// MyResult:DWord; bCreateProcess: boolean; lpStartupInfo: TStartupInfo; lpProcessInformation: TProcessInformation;begin DecodeDate(datetimepicker1.date,y,m,d); strFJDM:=listview1.items.item[i].subitems.strings[0]; configFile:=TIniFile.Create(gvExePath+'config.ini'); strPath:=configfile.ReadString(strFJDM,'FILE_PATH',''); sCommandLine:=format('%s %2.2d %2.2d %s',[strPath,m,d,strFJDM]); FillChar(lpStartupInfo, Sizeof(TStartupInfo), #0); lpStartupInfo.cb := Sizeof(TStartupInfo); lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW; lpStartupInfo.wShowWindow := SW_SHOW;//把这行改成SW_HIDE就可以了 statusbar1.Panels[0].text:=format('正在处理%s,请等待...',[listview1.items.item[i].caption]); if isTesting then showmessage(sCommandLine) else begin bCreateProcess := CreateProcess(nil, PChar(sCommandLine), nil, nil, True, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, lpStartupInfo, lpProcessInformation); application.ProcessMessages ; if bCreateProcess then begin WaitForSingleObject(lpProcessInformation.hProcess, INFINITE); //GetExitCodeProcess(lpProcessInformation.hProcess,MyResult); //if MyResult<> 0 then // showMessage(errhandler1(GetLastError())); end else showMessage(errhandler1(GetLastError())); end; statusbar1.Panels[0].text:='';end; MFC 如何用CMFCPropertyGridProperty处理浮点型数并将小数点精度设为2位? 吐血一万斤。用sdk实现list view 请问:大家知道有什么Image DLL可以下在? CPropertyPage的OnOK()问题 提示“内存不足”是什么意思??????????? 求教:要用cfile类需要include什么? 今天回家心情不错,散分!!! C++线程池如何实现?有什么好处?谁有源码? 求一个简单的类继承的例子?邮件:[email protected] windows me 的序列号? 控件中如何用大数组?
我之前写过一个程序,是批量调用批处理的。
用winexec可以啊。
不过就是得不到它的processID而已。
试试如下的程序?
procedure TmainForm.BatchItem(i:integer);
var
sCommandLine,strFJDM,strPath:string;
configFile:Tinifile;
y,m,d:word;
// MyResult:DWord;
bCreateProcess: boolean;
lpStartupInfo: TStartupInfo;
lpProcessInformation: TProcessInformation;
begin
DecodeDate(datetimepicker1.date,y,m,d);
strFJDM:=listview1.items.item[i].subitems.strings[0];
configFile:=TIniFile.Create(gvExePath+'config.ini');
strPath:=configfile.ReadString(strFJDM,'FILE_PATH','');
sCommandLine:=format('%s %2.2d %2.2d %s',[strPath,m,d,strFJDM]);
FillChar(lpStartupInfo, Sizeof(TStartupInfo), #0);
lpStartupInfo.cb := Sizeof(TStartupInfo);
lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;
lpStartupInfo.wShowWindow := SW_SHOW;//把这行改成SW_HIDE就可以了
statusbar1.Panels[0].text:=format('正在处理%s,请等待...',[listview1.items.item[i].caption]);
if isTesting then
showmessage(sCommandLine)
else begin bCreateProcess := CreateProcess(nil, PChar(sCommandLine),
nil, nil, True, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
nil, nil, lpStartupInfo, lpProcessInformation);
application.ProcessMessages ;
if bCreateProcess then
begin
WaitForSingleObject(lpProcessInformation.hProcess, INFINITE);
//GetExitCodeProcess(lpProcessInformation.hProcess,MyResult);
//if MyResult<> 0 then
// showMessage(errhandler1(GetLastError()));
end
else
showMessage(errhandler1(GetLastError()));
end;
statusbar1.Panels[0].text:='';
end;