Results 1 to 7 of 7

Thread: Only Run 1 At A Time

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Talking

    Is there a way to have it so 2 copies of your program are running at the same time. Like for instance someone opens yourporgram bydouble clicking on the exe then decides to double click on it again. 2 are going to run now. I thought about what if when I start the prog to write to the registry and say its running then when it gets shut down then write again to the registry and say its not running. But the porblem with this is if something crashes and the computer has to be shut down before that line of code runs then he can never use my prog again. Does anyone know how to do this? I hope I explained it well. Thanks!!
    Sincerely,
    Chris


    Email: [email protected]
    AIM: KnightsOfTheMoon
    WebPage: http://kom.wicre.com
    ----------------
    VB6 Professional
    Abit ST6-RAID
    1000 MHZ
    512 MB PC133 Ram
    Nvidia GeForce 2 Ultra 64 MB
    Maxtor 81.9 Gig
    Win 98 SE

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    Code:
    If App.PrevInstance = True Then
        MsgBox("The program is already running!")
        End
    End If
    source = http://www.vb-world.net/tips/tip25.html
    NXSupport - Your one-stop source for computer help

  3. #3
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    if you want to see if another version of your program is running, checkt the App.PrevInstance property:
    Code:
    If App.PrevInstance Then
        MsgBox "Another version is running"
        End
    End If
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  4. #4
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    sorry, dimava, your post didn't show up when i posted.
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  5. #5
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    yea, it happens to me all the time
    NXSupport - Your one-stop source for computer help

  6. #6

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Talking

    Hey thanks guy!!!! I apretiate your help!
    Sincerely,
    Chris


    Email: [email protected]
    AIM: KnightsOfTheMoon
    WebPage: http://kom.wicre.com
    ----------------
    VB6 Professional
    Abit ST6-RAID
    1000 MHZ
    512 MB PC133 Ram
    Nvidia GeForce 2 Ultra 64 MB
    Maxtor 81.9 Gig
    Win 98 SE

  7. #7
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Code:
    'DON'T USE END!
    'Use Unload <FORMNAME!>
    Unload Form2
    Unlod Me
    etc...
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width