Jon*_*Jon 4 c++ internet-explorer
我有一个用C++编写的程序,可以进行一些计算机诊断.在程序退出之前,我需要它来启动Internet Explorer并导航到特定的URL.我如何从C++中做到这一点?谢谢.
你在这里......我假设你在这里谈论MSVC++ ......
// I do not recommend this... but will work for you
system("\"%ProgramFiles%\\Internet Explorer\\iexplore.exe\"");
// I would use this instead... give users what they want
#include <windows.h>
void main()
{
ShellExecute(NULL, "open", "http://stackoverflow.com/questions/982266/launch-ie-from-a-c-program", NULL, NULL, SW_SHOWNORMAL);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12308 次 |
| 最近记录: |