[英]Windows: how can I run something in a new command window in such a way that the window closes when the process finishes or crashes?
[英]How to run process with no window
Process.run(
'adb',
['devices],
runInShell: true,
);
当我在android studio中运行app时,没有黑色window,但是当我双击***.exe运行app时,会看到黑色的window
这是一个 Dart 错误。
如那里的评论中所述,您现在可以通过在启动时创建自己的控制台并将其隐藏来解决它:
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
CreateAndAttachConsole();
} else {
AllocConsole();
ShowWindow(GetConsoleWindow(), SW_HIDE);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.