Declare Integer GetLastError In kernel32.dll as GetLastError Declare Integer FormatMessage In kernel32.dll as FormatMessage ; Integer dwFlags, ; String @lpSource, ; Integer dwMessageId, ; Integer dwLanguageId, ; String @lpBuffer, ; Integer nSize, ; Integer Arguments lcErrorTxt = ApiError() ? lcErrorTxt RETURN *-------------------------------- FUNCTION ApiError Local lcErrBuffer, lcErrorMess, liNewErr, lnErrorCode lcErrBuffer = REPL(CHR(0),1000) lnErrorCode = GetLastError() liNewErr = FormatMessage(0x1000; ,.NULL., lnErrorCode, 0, @lcErrBuffer,500,0) lcErrorMess = Transform(lnErrorCode) + " " + LEFT(lcErrBuffer, AT(CHR(0),lcErrBuffer)- 1 ) RETURN lcErrorMess>I'm still struggling with this API stuff. I think I've posted more messages in the last week than in the last year! Anyway, the latest road block I've hit is trying to turn off the error messages when copying files with SHFileOperation. I had no luck figuring out how to tell me when a file couldn't be copied, so I've resorted to copying one file at a time and checking the return value. That's slower, but it works. The trouble is I can't get it to shut up. I don't want it telling the user when there's an error. I found the constant FOF_NOERRORUI, but no value to go with it. So I went searching some more and found a code fragment that defined it to be 0x0400. But that can't be right because the minute I add that into the list, no files copy. Even if there's nothing wrong with the files and they copied just fine without that.