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,663 of 10,840   
   Jim Mack to Don   
   Re: Detect file opened by Notepad   
   14 Sep 08 12:24:27   
   
   XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: jmack@mdxi.nospam.com   
      
   Don wrote:   
   > "Ralph" wrote:   
   >>   
   >> Maybe you need to provide your own 'editor' and otherwise protect   
   >> the data?   
   >   
   > And that's EXACTLY what I believe to be the answer.  I think that's   
   > where I stand and either place a Rich Text box in my app for that   
   > purpose or create a detour so that if Notepad is detected as the   
   > default app about to lanuch the file, I can instead launch an app I   
   > know would work.   
   > Don   
      
   I haven't read this whole thread, but in your shoes I would tug at   
   this from the other end. Open the file yourself with exclusive access:   
   lock out all writes except your own.   
      
   If someone has the file already open, your open will fail and you can   
   deal with it as you like.   
      
   In the case of Notepad having the file open, since the file isn't   
   "really" open, you'll still be able to gain exclusive access. But if   
   the Notepad user tries to save her copy, she won't be able to. She'll   
   have to save under a different name or folder. So you're covered   
   either way.   
      
   --   
       Jim Mack   
       MicroDexterity Inc   
       www.microdexterity.com   
      
   --- 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