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,675 of 10,840   
   PeterD to Don   
   Re: Detect file opened by Notepad   
   15 Sep 08 09:17:40   
   
   XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: peter2@hipson.net   
      
   On Mon, 15 Sep 2008 12:31:00 GMT, dsarvas@yahoo.com (Don) wrote:   
      
   >On Sun, 14 Sep 2008 17:53:29 -0400, PeterD  wrote:   
   >   
   >>On Sun, 14 Sep 2008 15:19:34 GMT, dsarvas@yahoo.com (Don) wrote:   
   >>   
   >>>On Sun, 14 Sep 2008 08:50:24 -0400, PeterD  wrote:   
   >>>   
   >>>>On Sat, 13 Sep 2008 22:17:45 GMT, dsarvas@yahoo.com (Don) wrote:   
   >>>>   
   >>>>>On Sat, 13 Sep 2008 17:53:38 -0400, PeterD  wrote:   
   >>>>>   
   >>>>>>That old 'between a rock and a hard place' comes to mind. Consider   
   >>>>>>this, can you perhaps run through the windows of open applications   
   >>>>>>looking for Notepad, and seeing what file that window has open? That   
   >>>>>>*might* work, but would be Notepad specific. I'm sure there are other   
   >>>>>>programs that may present the same problems, too, however.   
   >>>>>   
   >>>>>That actually has possibilties.  I do know how to enumerate through   
   >>>>>all open windows and even target a Notepad window and it's caption,   
   >>>>>but I would have to do so by accessing all workstations on the network   
   >>>>>until I find one that is running that file via Notepad.   
   >>>>   
   >>>>Ouch... Yea, you're screwed. Maybe permissions is an answer. Only your   
   >>>>application has write permissions for the file?   
   >>>   
   >>>Considering that, also.  Might keep all files in folders with specific   
   >>>rights made available only if they access the files through my app or   
   >>>make the folders invisible except via the app.   
   >>>   
   >>>I think the answer is for my app to detect that they are attempting to   
   >>>open a file with Notepad and create a detour, causing the file to open   
   >>>in my app or an app I know will lock the file.  My app already does   
   >>>that, but I didn't want to have to do that.   
   >>   
   >>What extension are you using for your file? If you are using a   
   >>commonly defined extension (.TXT, .DAT, etc.) you may find you are   
   >>headed down a rocky road. You probably should:   
   >>   
   >>1. create your own unique extension (remember, you are not limited to   
   >>three characters.) Search to make sure your extension is reasonably   
   >>unique.   
   >>   
   >>2. Setup Windows so that when a file with that extension is clicked in   
   >>Explorer, it opens in your program, not notepad.   
   >>   
   >   
   >I considered that and I think that can work.  When the user selects   
   >that particular file, my app can rename the file as you suggest.   
      
   Rename *what* file? No where did I suggest renaming files. What file   
   are you opening? A .TXT file?   
      
   > We   
   >receive so many files from so many sources it would have to be done   
   >this way rather than renaming every file as we receive them manually.   
      
   OK, so what is the purpose of this exercise?   
      
   >   
   >But my concern is that the files would always have to remain with   
   >their new extension or renamed back after the user is done and if the   
   >program ends unexpectedly, there could be a problem with the file left   
   >named with the new extension rather than the .txt extension.  I'm   
   >thinking down the road how we might end up if we have text files left   
   >with two different extensions.   
      
   Renaming is a very bad idea... Copying is also bad... Both can and   
   will create problems.   
      
   >   
   >I'm still inclined to set up my app to detour a user to another app   
   >that does keep the file open or present a pop-up warning if they   
   >choose to allow Notepad to open the file, they could be making changes   
   >while others are doing the same at that very moment.   
      
   Since I'm totally confused as to what you are trying to achieve, I'm   
   out of ideas. I only know that it appears that you want something that   
   (IMHO) is impossible.   
      
   >   
   >>>   
   >>>>   
   >>>>>Seems like   
   >>>>>that would be the challenge of my lifetime but I might just try   
   >>>>>researching that one.   
   >>>>>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