winapi - ShellExecute 执行后保持屏幕并等待字符
问题描述
#import "shell32.dll"
int ShellExecuteW(int hwnd,string operation,string file,string parameters,string directory,int showCmd);
#import
string strParameters = "/c terms.exe";
int result = ShellExecuteW(0, "open", "cmd.exe", strParameters , NULL, 1);
if (result <= 32) Print("Shell Execute Failed: ", result);
以上是我使用 windows 10 ShellExecute 命令在 MQL 中执行外部可执行文件的代码。但是程序中存在一个问题,我在终端上看到了这个问题,但是随着终端离开而没有让我阅读错误,我无法调试问题。请让我知道如何保持屏幕直到我按下键。这样我就可以阅读该消息。
请帮我解决一下这个。
解决方案
更改“cmd.exe”参数:
string strParameters = "/k terms.exe";
在命令执行后,这会使控制台窗口保持打开状态。
推荐阅读
- debugging - 这些十六进制值在此字体二进制文件中的含义
- scala - Akka 监督默认行为
- laravel - 如何在前端实现中使用“Laravel Voyager 管理页面或帖子中的特定设置块”?
- typescript - 如何使用 awesome-typescript-loader 和 babel 来转译特定的节点模块?
- bash - How to loop through each line of a file, name the file after the third field, and then take the contents of each line and put it in the file
- git - “弧形移植”和“弧形贴片”有什么区别?
- python - 将列表列表转换为字典
- javascript - 在线生成pdf时的奇怪问题
- excel - 使用没有循环的 VBA 将数据从 Excel 导出到 SQL Server
- java - Urlspan无法触发点击Textview