a.bat >a.txt
a.txt就是你要的
a.txt就是你要的
解决方案 »
- DevExpress VCL使用问题
- 如何在TDBMemo中显示字段长度大于500个字符的字段值
- 关于他TreeView选中其中的item,执行一段代码,应该怎么写?
- 建立数据库
- 程序在部分XP版本上运行不正常,如何解决
- 各位大哥,有谁能写一个判断矩阵等价问题的算法?,急着救命。。。。
- delphi6可以把外部exe,dll文件封装起来吗?
- 内存泄漏问题,请教?
- 要实现读入EXCEL的格式,高手们有什么高见啊
- 我这两天是不是见鬼了!!!高手帮忙,分析原因。
- 简单的问题搜索不到,只有问大家了:怎样用ADO把access数据库中表的数据导入到MS SQL数据库中的表中?
- 有谁知道pe文件头结构中import表的细节?
用多线程;启动dos程序时,捕捉屏幕的程序(有一个API可以解决)但由于DOS信息很快闪过,所以要控制截屏,用多线程.the API is
bitblt(),example:
bitblt(image.canvas.handle,0,,image.wieth,image.height,getdc(0),0,0,scrcopy)
const ReadBuffer = 2400;
var
Security : TSecurityAttributes;
ReadPipe,WritePipe : THandle;
start : TStartUpInfo;
ProcessInfo : TProcessInformation;
Buffer : Pchar;
BytesRead : DWord;
Apprunning : DWord;
begin
With Security do
begin
nlength := SizeOf(TSecurityAttributes);
binherithandle := true;
lpsecuritydescriptor := nil;
end;
if Createpipe (ReadPipe, WritePipe, @Security, 0) then
begin
Buffer := AllocMem(ReadBuffer + 1);
FillChar(Start,Sizeof(Start),#0);
start.cb := SizeOf(start);
start.hStdOutput := WritePipe;
start.hStdInput := ReadPipe;
start.dwFlags := STARTF_USESTDHANDLES + STARTF_USESHOWWINDOW;
start.wShowWindow := SW_HIDE;
if CreateProcess(nil,PChar(DosApp),@Security,@Security,true,NORMAL_PRIORITY_CLASS,
nil,nil,start,ProcessInfo) then
begin
repeat
Apprunning := WaitForSingleObject(ProcessInfo.hProcess,100);
Application.ProcessMessages;
until (Apprunning <> WAIT_TIMEOUT);
Repeat
BytesRead := 0;
ReadFile(ReadPipe,Buffer[0],ReadBuffer,BytesRead,nil);
Buffer[BytesRead]:= #0;
OemToAnsi(Buffer,Buffer);
AMemo.Text := AMemo.text + String(Buffer);
until (BytesRead < ReadBuffer);
end;
FreeMem(Buffer);
CloseHandle(ProcessInfo.hProcess);
CloseHandle(ProcessInfo.hThread);
CloseHandle(ReadPipe);
CloseHandle(WritePipe);
end;
end;调用实例:RunDosInMemo('chkdsk.exe c:\',Memo1);
xx.bat中的内容:如: scandisk c: > c:\Result.txt