# include <Windows.h>
# include <stdio.h>
# include <TlHelp32.h>
int main()
{
//定义需要的结构体
STARTUPINFO si = { 0 };
si.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION pi = { 0 };
//调用API 创建进程
//CreateProcess(TEXT("C:/Program Files/Tencent/QQ/Bin/QQScLauncher.exe"),
//NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
//TCHAR szName[] = TEXT("calc.exe");
//CreateProcess(NULL, szName, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
//CreateProcess(TEXT("D:\\dajiba.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
CreateProcess(TEXT("E:\\通讯工具全部集合\\QQ\\Bin\\QQScLauncher.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
// CreateProcess(TEXT("c:\\windows\\system32\\notepad.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
Sleep(5000);
//终止进程
TerminateProcess(pi.hProcess, 1);
getchar();
getchar();
return 0;