从基于对话框的程序中运行GUI程序,但等待它关闭。 [英] Running a GUI program from within a dialog based program but waiting for it to close.

查看:56
本文介绍了从基于对话框的程序中运行GUI程序,但等待它关闭。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,主题行说明了一切。当用户单击按钮并等待GUI返回时,我需要启动一个Windows GUI程序。我一直在使用:: system而且我可以运行GUI但是:: system函数会立即返回...



任何帮助?



Ron H.

OK, The subject line says it all. I need to start a windows GUI program when my user clicks a button and wait for the GUI to return. I''ve been mucking around with ::system and I can get the GUI running but the ::system function returns immediately...

Any Help?

Ron H.

推荐答案

好问题,罗恩!尝试做这样的事情:



Good question, Ron! Try to do something like this:

STARTUPINFO info={sizeof(info)};
PROCESS_INFORMATION processInfo;
if (CreateProcess(path, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo))
{
    ::WaitForSingleObject(processInfo.hProcess, INFINITE);
    CloseHandle(processInfo.hProcess);
    CloseHandle(processInfo.hThread);
}





祝你好运!



Good luck!


这篇关于从基于对话框的程序中运行GUI程序,但等待它关闭。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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