gpt4 book ai didi

c++ - 如何以编程方式打开 Run c++?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:17:21 25 4
gpt4 key购买 nike

问题是如何从 C++ 以编程方式打开运行?我知道有一些功能可以替代它,例如 shellexec、winexec,但对于某些任务,我只需要显示“运行”对话框即可。

最佳答案

运行对话框位于 shell32.dll 中,使用函数 RunFileDlg。显示对话框的一种方法是使用 rundll32.exe 调用该函数。使用 CreateProcess Win32 API 执行以下命令:

rundll32.exe shell32.dll,#61

(其中 #61 是 RunFileDlg 函数的序号)。

shell32.dll 函数引用:http://www.geoffchappell.com/viewer.htm?doc=studies/windows/shell/shell32/api/index.htm

希望这对您有所帮助。

关于c++ - 如何以编程方式打开 Run c++?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4356270/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com