All queued file transfers are handled by a queue manager which
executes asynchronously in a background worker thread. This worker
thread is created when the FtpStartQueue function is called and
terminates when all files in the queue have been processed, or when
the FtpStopQueue function is called. This function will return
the queue handle associated with that worker thread.
The most common use of this function would be to obtain the handle
for the queue from within a queue event handler. The application would
pass in a value of zero as the thread ID and the function will return
the handle to the queue which invoked the event notification.
If you call this function outside of an event handler and the
dwThreadId parameter is zero, or if the queue is idle and not
transferring files, this function will return INVALID_QUEUE. The
thread ID is only valid while the queue manager is actively processing
files in the queue.