Windows有自己的“调用其他.exe”函数(C ++)

编程入门 行业动态 更新时间:2024-10-11 05:22:43
本文介绍了Windows有自己的“调用其他.exe”函数(C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道在C ++有一个函数

I know in C++ there is a function

system("example.exe");

运行另一个程序,需要include stdlib.h 。

that runs another program, put it requires the include stdlib.h.

因为我已经包括了'windows.h',是有一个等价的 system c $ c>函数在Windows中?

Because I am already including 'windows.h', is there an equivilant to the system() function in Windows?

推荐答案

有 CreateProcess 运行特定的可执行文件,或 ShellExecute 运行程序或打开文档及其关联程序。

There is CreateProcess to run a specific executable, or ShellExecute to run programs or open documents with their associated program.

如果到其他平台的可移植性是任何问题,我会坚持使用系统。 #including stdlib.h不会杀了你;)

If portability to other platforms is any issue at all, I'd stick with system. #including stdlib.h won't kill you ;)

更多推荐

Windows有自己的“调用其他.exe”函数(C ++)

本文发布于:2023-11-13 06:03:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583643.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自己的   函数   Windows   exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!