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,666 of 10,840   
   expvb to expvb   
   Re: Detect file opened by Notepad   
   14 Sep 08 14:14:07   
   
   XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: nobody@cox.net   
      
   "expvb"  wrote in message   
   news:uJXjLUpFJHA.616@TK2MSFTNGP06.phx.gbl...   
   > "Don"  wrote in message   
   > news:48cd4c0a.2185703@news.west.cox.net...   
   >> I'm assuming you mean that Notepad can be used to open a file with   
   >> exclusive access.   
   >   
   > Not sure what you mean, but if you open the file exclusively, like the   
   > following, Notepad can't even read it:   
   >   
   > Option Explicit   
   >   
   > Dim f As Long   
   >   
   > Private Sub Command1_Click()   
   > f = FreeFile   
   > Open App.Path & "\Test.txt" For Binary Access Read Write Lock Read Write   
   > As f   
   >   
   > End Sub   
   >   
   > Private Sub Command2_Click()   
   >    Close f   
      
   I forgot to add the following line here, so the file number is not closed   
   again in Form_Unload:   
      
   f = 0   
      
   > End Sub   
   >   
   > Private Sub Form_Unload(Cancel As Integer)   
   >    If f <> 0 Then   
   >        Close f   
   >    End If   
   > End Sub   
   >   
   >   
      
   --- 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