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,665 of 10,840   
   expvb to Don   
   Re: Detect file opened by Notepad   
   14 Sep 08 14:09:33   
   
   XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: nobody@cox.net   
      
   "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   
   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