Windows有自己的“调用其他.exe”函数(C ++) [英] Does Windows have its own 'call other .exe' function (C++)

查看:328
本文介绍了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 ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆