如何在BN_CLICKED上启动外部应用程序? [英] How to launch an external application on BN_CLICKED?

查看:212
本文介绍了如何在BN_CLICKED上启动外部应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Windows编程的新手。我正在做一个简单的启动程序的WinCE使用VC ++(不是MFC)。到目前为止,我创建了基本的界面和按钮和东西。我只想知道当用户点击按钮(在BN_CLICKED上)时启动外部应用程序的最佳方法。



我发现了一些方法,如ShellExecute,CreateProcess和其他。但我不能让它工作(但?)。任何合适的参考或简单的例子对此?

解决方案

问题不要紧, ,但... ...



ShellExecute 是一个很好的方法来启动程序(和任何其他类型的文件的默认程序)在Windows中,但使用 CreateProcess ,如果你需要一个返回代码,或者如果你需要等待程序完成的能力。 / p>

I'm fairly new to Windows programming. I'm doing a simple launcher app for WinCE using VC++ (not MFC). So far I've created the basic interface and buttons and stuff. I just wanted to know the best way to launch an external application when the user clicks the button (on BN_CLICKED).

I found some methods such as ShellExecute, CreateProcess and others. But I couldn't get it to work (yet?). Any suitable reference or simple example on this?

解决方案

The question don't matter that it happens inside the event of a button click, but...

ShellExecute is a good way to start programs (and the default program for any other type of files) in Windows, but use CreateProcess if you need a return code, or if you need the ability to wait for the program to finish.

这篇关于如何在BN_CLICKED上启动外部应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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