进程,线程

//创建进程=============================================
STARTUPINFO si = {sizeof(STARTUPINFO)};
PROCESS_INFORMATION pi;
BOOL ret = CreateProcess(NULL, pszCmdLine, NULL, NULL, FALSE, 0/*CREATE_SUSPENDED*/, NULL, NULL, &si, &pi);

ShellExecute();

//创建线程=============================================

CreateThread();
SHCreateThread();
CreateRemoteThread();
AfxBeginThread();
_beginthread(); _beginthreadex();

 

//进程, 线程 HANDLE ID=============================================
GetCurrentProcess / GetCurrentThread     获取当前进程/线程句柄
GetCurrentProcessId / GetCurrentThreadId  获取当前进程/线程ID
OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId);  跟据进程ID得到进程HANDLE
GetProcessId(HANDLE hProcess);    // 根据HANDLE得到ID
GetProcessIdOfThread(HANDLE hThread);
GetWindowThreadProcessId();    // 根据窗口得到 进程&线程 ID

EnumProcesses();
CreateToolhelp32Snapshot();
GetModuleFileName(HMODULE hModule, );
GetModuleHandle(LPCTSTR lpModuleName);

你可能感兴趣的:(进程,线程)