Adds a user-mode asynchronous procedure call (APC) object to the APC queue of the specified thread.
C++
DWORD QueueUserAPC(
PAPCFUNC pfnAPC,
HANDLE hThread,
ULONG_PTR dwData
);
pfnAPC
A pointer to the application-supplied APC function to be called when the specified thread performs an alertable wait operation. For more information, see APCProc.
hThread
A handle to the thread. The handle must have the THREAD_SET_CONTEXT access right. For more information, see Synchronization Object Security and Access Rights.
dwData
A single value that is passed to the APC function pointed to by the pfnAPC parameter.
If the function succeeds, the return value is nonzero.
PAPCFUNC
要用stdcall,PAPCFUNC callback function
An application-defined completion routine. Specify this address when calling the QueueUserAPC function. The PAPCFUNC type defines a pointer to this callback function. APCProc is a placeholder for the application-defined function name.
C++
PAPCFUNC Papcfunc;
void _stdcall Papcfunc(
ULONG_PTR Parameter
)
{...}
Parameter
This function does not return a value.