XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: dsarvas@yahoo.com   
      
   On Sat, 13 Sep 2008 16:55:08 -0500, "Ralph"   
    wrote:   
      
   >   
   >"Don" wrote in message   
   >news:48cbf7a3.5136375@news.west.cox.net...   
   >>   
   >> I wrote an app that alerts a user who attempts to open a file that the   
   >> file is currently in use. It works fine except when the file is   
   >> opened by Notepad. If a text file is opened, most computers are   
   >> configured to use Notepad to open the file by default and if they are   
   >> configured to use Notepad by default I want it to remain that way   
   >> rather than retrieve the text into my app or force the user to use   
   >> another app to read the file. I'm using the following code I found   
   >> online and lErrNum returns a value of zero if Notepad has the file   
   >> open but returns 70 when most other files are open using another   
   >> application.   
   >>   
   >> Don   
   >   
   >You might try and detect if the file has been changed since you last chewed   
   >on it (or while you are chewing on it)   
   >   
   >Take a look at FindFirstChangeNotification, FindNextChangeNotification.   
   >   
   >-ralph   
   >   
   >   
   I saw that mentioned in the first response and although that would not   
   work, I took a look at it. It can certainly be a handy tool, but I   
   need to detect that the file is currently open to prevent another user   
   from using it which just can't be done. One possibility I might look   
   into is whether I can search all workstations to determine if that   
   particular file is open at any particular workstation on the network.   
   That would work, but I think I"m just dreaming here.   
   Don   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|