Platform SDK: DLLs, Processes, and Threads |
The ThreadProc function is an application-defined function that serves as the starting address for a thread. Specify this address when calling the CreateThread or CreateRemoteThread function. The LPTHREAD_START_ROUTINE type defines a pointer to this callback function. ThreadProc is a placeholder for the application-defined function name.
DWORD WINAPI ThreadProc( LPVOID lpParameter // thread data );
The function should return a value that indicates its success or failure.
A process can obtain the return value of the ThreadProc of a thread it created with CreateThread by calling the GetExitCodeThread function. A process cannot obtain the return value from the ThreadProc of a thread it created with CreateRemoteThread.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winbase.h; include Windows.h.
Processes and Threads Overview, Process and Thread Functions, CreateThread, CreateRemoteThread, GetExitCodeThread