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,140 of 10,840   
   Karl E. Peterson to Tom Rogers   
   Re: Single Application Run   
   13 Jul 06 14:12:04   
   
   From: karl@mvps.org   
      
   Tom Rogers wrote:   
   > How do I make it so that once my application (.exe) is running, if   
   > the user tries to run a second instance of the program, it is not   
   > allowed.   
   >   
   > I want my program to be able to have only one instance of it running,   
   > period.   
      
   There are quite a number of ways.  The simplest is something like this:   
      
      Sub Main   
         If App.PrevInstance Then Exit Sub   
         ...   
      
   If you know the caption of your app, you can enhance this like:   
      
      Sub Main   
         If App.PrevInstance Then   
            AppActivate MyCaption   
            Exit Sub   
         End If   
         ...   
      
   For more ideas, see http://vb.mvps.org/samples/PrevInst   
   --   
      
   --- 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