常用

Posted on 2010-09-13 19:14 傅先生 阅读(167) 评论(0)  编辑 收藏 引用 所属分类: 内核相关编程
// CreateP.cpp : Defines the entry point for the console application.
//这个程序是建立进程的实例,打开了CMD命令行程序,并显示了进程号和主线程号

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

#define SZFILENAME       ".\\TraceMe.exe"  //目标文件名

int main(int argccharargv[])
{

    
printf("dfdfd");

    
char chPath[301]= "ToTelephone.exe";
    
char path[200]= "\\wordpad.exe";
    
    
    ::
GetCurrentDirectory(300,(LPTSTR)chPath);//得到当前目录
    
strcat(chPath,path);
    
STARTUPINFO si;
    
PROCESS_INFORMATION pi;
    
ZeroMemory( &pisizeof(pi) );
    
ZeroMemory( &sisizeof(si) );
    
si.cb sizeof(si);
    
// Start the child process
ShellExecute(NULL,NULL,_T("\\wordpad.exe"),NULL,chPath,SW_SHOW);

    
if(CreateProcess(chPath""NULLNULLFALSE0NULLNULL, &si, &pi))
    {

    }
    
else 
    
{

    }

    
return 0;
}

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


posts - 54, comments - 5, trackbacks - 0, articles - 2

Copyright © 傅先生