📄 createthread
字号:
#include"stdafx.h"
#include"iostream.h"
#include"process.h"
#include"windows.h"
#include"stdio.h"
DWORD WINAPI mythread1(LPVOID lpParameter)
{
printf("hello!\n");
DWORD exitCode;
ExitThread(exitCode);
return 0;
}
DWORD WINAPI mythread2(LPVOID lpParameter)
{
printf("I am here!\n");
DWROD exitCode;
ExitThread(exitCode);
return 0;
}
void main()
{
HANDLE handle1,handle2;
DWORD dw1,dw2;
handle1=CreateThread(NULL,0,mythread1,NULL,0,&dw1);
Sleep(1000);
handle2=CreateThread(NULL,0,mythread2,NULL,0,&dw2);
Sleep(1000);
printf("Now!Exit!\n");
CloseHandle(handle1);
CloseHandle(handle2);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -