C++ Programmer's Cookbook

{C++ 基础} {C++ 高级} {C#界面,C++核心算法} {设计模式} {C#基础}

vc中打开exe文件

FROM:http://blogs.msdn.com/oldnewthing/archive/2004/11/26/270710.aspx

// test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <shellapi.h>

int main(int argc, char* argv[])
{

    SHELLEXECUTEINFO shell = { sizeof(shell) };
    shell.fMask = SEE_MASK_FLAG_DDEWAIT;
    shell.lpVerb = "open";
    shell.lpFile = "C:\\windows\\NOTEPAD.EXE";
    shell.nShow = SW_SHOWNORMAL;
    BOOL ret = ShellExecuteEx(&shell);

    //"";
    printf("Hello World!\n%d",ret);
    getchar();
    return 0;
}

posted on 2005-12-24 14:38 梦在天涯 阅读(3350) 评论(0)  编辑 收藏 引用 所属分类: CPlusPlusMFC/QT


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


公告

EMail:itech001#126.com

导航

统计

  • 随笔 - 461
  • 文章 - 4
  • 评论 - 746
  • 引用 - 0

常用链接

随笔分类

随笔档案

收藏夹

Blogs

c#(csharp)

C++(cpp)

Enlish

Forums(bbs)

My self

Often go

Useful Webs

Xml/Uml/html

搜索

  •  

积分与排名

  • 积分 - 1785153
  • 排名 - 5

最新评论

阅读排行榜