DWORD WINAPI YourThreadFunc(LPVOID lpvThreadParm);
void FunCount(PVOID arg)
{
while(1)
{
}
}
void Function1(PVOID arg)
{
while(1)
{
}
}
HANDLE CreateThread(
//线程安全属性
//堆栈大小
//线程函数
//线程参数
//线程创建属性
//线程ID
);
LPVOID lpvThreadParm,DWORD fdwCreate,LPDWORDlpIDThread);
handle=(HANDLE)_beginthread(FunCount,0, NULL);
handle1=(HANDLE)_beginthread(Function1,0,NULL);
BOOL TerminateThread(HANDLE hThread, DWORD dwExitCode);
DWORD ResumeThread(HANDLE hThread);
DWORD SuspendThread(HANDLE hThread);
- #include<Windows.h>
- #include<iostream>
- #include<process.h>
- usingnamespace
- struct
- int
- char
- voidPVOID
- int
- while
- voidPVOID
- int
- while
- if
- voidvoid
- <<myp->a<<
- //设置退出码
- int
- int
- HANDLEHANDLE
- DWORD
- HANDLEHANDLE
- 'A'
- HANDLEHANDLE)_beginthread(myfun3,0,&e);//传入参数
- if(GetExitCodeThread(handle3,&sid))cout<<
- //如果不加这一句下面的GetExitCodeThread获得的就是259
- //suspend
- while
- if(i>2)ResumeThread(handle);//resume
文章来源: c++的进程和线程【windows】