My guess is that Notepad opens the file for reading only (and only tries to open it for writing if the user wants to save, at which point it will also fail), when Excel or Word or the likes opens the file it probably allows other processes to read the file, but not to write to them (this would explain how you get a "open for reading only" option from Word if you try to open a document that is opened by another word instance/another user's word...). Can it be that when you use CreateFile to open the file you try to open it for writing?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <