Creates a thread that executes within the address space of the calling process.
/* sample declaration of thread start */
DWORD WINAPI ThreadProc(
LPVOID lpParameter
);
HANDLE CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
DWORD dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
LPDWORD lpThreadId
);
lpThreadAttributesdwStackSizelpStartAddress
DWORD WINAPI ThreadProc (
LPVOID lpParameter
);
Note: Do not set lpStartAddr to NULL. Passing this value in the parameter causes the function to return ERROR_INVALID_PARAMETER.
lpParameterdwCreationFlagsIf the flag is not specified, the thread starts immediately after creation.
lpThreadIddwCreationFlags only the CREATE_SUSPENDED flags is recognized.dwStackSize is adjusted up to a multiple of 4K bytes.lpStartAddress parameter. If this function returns, the DWORD return value terminates the thread in an implicit call to ExitThread. To get the thread's return value, use GetExitCodeThread.| Versions | Defined in | Include | Link to |
|---|---|---|---|
| INtime 3.0 | intime/rt/include/winbase.h | windows.h | iwin32.lib |