|

可直接替换使用。
现在易语言已经越来越跟不上时代了,连精易模块都停更了。不知道以后论坛会不会像官方论坛那样关了。只能希望逐渐越改越好吧。
|
程序_运行Ex | 逻辑型 | | |
命令行 | 文本型 | | | | 等待运行完毕 | 逻辑型 | | | | 窗口显示方式 | 整数型 | | | | 标准输入数据 | 字节集 | | | | 运行返回值 | 整数型 | | | | 标准输出数据 | 字节集 | | | | 标准错误数据 | 字节集 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | startupInfo | STARTUPINFO | | | pipeAttr | SECURITY_ATTRIBUTES | | | processInfo | 精易_进程结构 | | | hRead | 整数型 | | | hWrite | 整数型 | | | hErrorRead | 整数型 | | | hErrorWrite | 整数型 | | | size | 整数型 | | | result | 逻辑型 | | | 结果字节集 | 字节集 | | |
startupInfo.cb = 68 startupInfo.dwFlags = #STARTF_USESHOWWINDOW 判断 (窗口显示方式 = #隐藏窗口 ) startupInfo.wShowWindow = #SW_HIDE  判断 (窗口显示方式 = #最小化激活 ) startupInfo.wShowWindow = #SW_SHOWMINIMIZED 判断 (窗口显示方式 = #最大化激活 ) startupInfo.wShowWindow = #SW_SHOWMAXIMIZED 判断 (窗口显示方式 = #普通不激活 ) startupInfo.wShowWindow = #SW_SHOWNOACTIVATE 判断 (窗口显示方式 = #最小化不激活 ) startupInfo.wShowWindow = #SW_SHOWMINNOACTIVE    startupInfo.wShowWindow = #SW_SHOWNORMAL  如果真 (是否为空 (标准输入数据 ) = 假 或 是否为空 (标准输出数据 ) = 假 或 是否为空 (标准错误数据 ) = 假) startupInfo.dwFlags = 位或 (startupInfo.dwFlags, #STARTF_USESTDHANDLES ) pipeAttr.nLength = #sizeof_SECURITY_ATTRIBUTES  pipeAttr.bInheritHandle = 真 CreatePipe (hRead, hWrite, pipeAttr, 0 ) CreatePipe (hErrorRead, hErrorWrite, pipeAttr, 0 ) 如果真 (是否为空 (标准输入数据 ) = 假) WriteFile (hWrite, 标准输入数据, 取字节集长度 (标准输入数据 ), 0, 0 )  startupInfo.hStdInput = hRead    如果真 (是否为空 (标准输出数据 ) = 假)  startupInfo.hStdOutput = hWrite    如果真 (是否为空 (标准错误数据 ) = 假)  startupInfo.hStdError = hErrorWrite    如果真 (CreateProcessA (0, 命令行, 0, 0, 真, 0, 0, 0, startupInfo, processInfo ))  result = 真  如果真 (等待运行完毕 )  判断循环首 (WaitForSingleObject (processInfo.进程句柄, 100 ) = #WAIT_TIMEOUT )   如果真 (PeekNamedPipe_字节集 (hRead, 结果字节集, 0, 0, size, 0 ))     结果字节集 = 取空白字节集 (size )    如果真 (size > 0 )    ReadFile (hRead, 结果字节集, size, 0, 0 )     标准输出数据 = 标准输出数据 + 结果字节集      结果字节集 = { }           判断循环尾 ()  如果真 (是否为空 (运行返回值 ) = 假)  GetExitCodeProcess (processInfo.进程句柄, 运行返回值 )     如果真 (是否为空 (标准输出数据 ) = 假)   如果真 (PeekNamedPipe_字节集 (hRead, 结果字节集, 0, 0, size, 0 ))     结果字节集 = 取空白字节集 (size )    如果真 (size > 0 )    ReadFile (hRead, 结果字节集, size, 0, 0 )     标准输出数据 = 标准输出数据 + 结果字节集               如果真 (是否为空 (标准错误数据 ) = 假)   如果真 (PeekNamedPipe_字节集 (hErrorRead, 标准错误数据, 0, 0, size, 0 ))     标准错误数据 = 取空白字节集 (size )    如果真 (size > 0 )    ReadFile (hErrorRead, 标准错误数据, size, 0, 0 )              CloseHandle (processInfo.进程句柄 ) CloseHandle (processInfo.线程句柄 ) 如果真 (是否为空 (标准输入数据 ) = 假 或 是否为空 (标准输出数据 ) = 假 或 是否为空 (标准错误数据 ) = 假) CloseHandle (hRead ) CloseHandle (hWrite ) CloseHandle (hErrorRead ) CloseHandle (hErrorWrite ) 返回 (result )
|
评分
-
查看全部评分
|