浙林龙哥

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
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-07-14 21:18  浙林龙哥  阅读(402)  评论(1编辑  收藏  举报