Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15210317
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类: C/C++

2008-05-31 11:39:13

for c++builder,用于vc应该把消息框改一下就可以了
    void contour(void){
    char ln[100];
      int make;
      char str[100]="";
      char *tip="不能执行:";
    sprintf(ln,"%s\\%s",getcurrentdir(),"watson.exe");
    char path[100];
    sprintf(path,"%s",getcurrentdir());
    chdir(path);
    //showmessage(ln);
      startupinfo startinfo;
      process_information procinfo;
      strcat(str,tip);
      strcat(str, ln);
      getstartupinfo(&startinfo);
      startinfo.dwflags =startf_useshowwindow;
      startinfo.wshowwindow=sw_hide ;
      make=createprocess(null,ln,null,null,false,0,null,null,&startinfo,&procinfo);
      if (!make)
      {
      messagebox(null, str, "提示", mb_ok);
      }
      waitforsingleobject(procinfo.hprocess, infinite);
    }

 

阅读(469) | 评论(0) | 转发(0) |
0

上一篇:软件试用次数的限制

下一篇:读磁片磁区

给主人留下些什么吧!~~