home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,655 of 10,840   
   Don to nt_consulting64@yahoo.com   
   Re: Detect file opened by Notepad   
   13 Sep 08 22:13:28   
   
   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)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca