#include <Windows.h> //WINBASEAPI //BOOL //WINAPI //CreateProcessW( //_In_opt_ LPCWSTR lpApplicationName,//执行程序名称 //_Inout_opt_ LPWSTR lpCommandLine,//命令行 //_In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,//进程安全 //_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,//进程主线程安全 //_In_ BOOL bInheritHandles,//附加参数 //_In_ DWORD dwCreationFlags,//创建参数 //_In_opt_ LPVOID lpEnvironment,//环境变量的指针 //_In_opt_ LPCWSTR lpCurrentDirectory,//进程当前路径 //_In_ LPSTARTUPINFOW lpStartupInfo,//进程启动的附加信息 //_Out_ LPPROCESS_INFORMATION lpProcessInformation//进程标识符 //); void main() { STARTUPINFO si = { sizeof(si) };//保存进程信息 PROCESS_INFORMATION pi;//进程信息 si.wShowWindow = 1;//显示窗口 si.dwFlags = STARTF_USESHOWWINDOW;//显示窗口 wchar_t str[100] = L"notepad"; CreateProcess(NULL, str, NULL, NULL, 0, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi); system("pause"); }