DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: prev instance

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    prev instance

    [Originally posted by kodaka]

    i am trying to make a prev instance... the app.previnstance sounds good, but cannot detect if the same binary is executed on different paths... any help?

    danke


  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:prev instance

    [Originally posted by Daniel Simpson-Dernovoy]

    Hi there,

    do you have some more information, I do not understand why you want to create a previous instance of an application or thread !!

    An instance of a program cannot be a new instance without there being a previous instance and the
    App.Previnstance property is readonly,

    Dan.

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:prev instance

    [Originally posted by kodaka]

    well...

    the app maybe copy to a different folder and than
    it can be executed not?

    I have the app with game.exe on C:\Games. Then, the dude copy the file to C:\Hot and click. The file is executed, so it is an instance from it!

    :)

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:prev instance

    [Originally posted by HighCommander]

    If you're trying to make sure they only run the program from the "C:\Games" directory, check App.Path when the program starts. If it isn't the directory you want, exit the program

    Private Sub Main()
    If App.Path = "C:\Games" then
    .
    . Run you program
    .
    Else
    MsgBox "Why did you move the program?"
    End If
    End Sub

    App.PrevInstance will let you know if the program is already running in memory, no matter where it is run from "C:\Games"... "C:\Stuff\Whatever" doesn't matter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center