Use the Win32 SHFileOperation() API to copy the file with the FOF_RENAMEONCOLLISION flag:
If you need to know what the copied filename was renamed to, include the FOF_WANTMAPPINGHANDLE flag as well:
Alternatively, on Windows Vista+, you can use the IFileOperation API instead, using IFileOperation.SetOperationFlags() to set the FOF_RENAMEONCOLLISION flag, IFileOperation.CopyItem() and IFileOperation.PerformOperations() to perform the copy, and if needed use an IFileOperationProgressSink event sink to discover the copied filename in the PostCopyItem event.