Results 1 to 8 of 8

Thread: Open just one.

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    10
    How can I code an VB6 exe to be loaded once only into memory, so that when the user clicks on the exe again it goes to the already loaded exe.

    Thank you
    Rayed

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    There is a tip to see if your program is already open. Then in the load statement you can just see if it is open.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    10
    Steve Can you tell me the something more about it?

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    Code:
    If App.PrevInstance = True Then
       Unload Me
       End
    End If
    Wade
    Wade

  5. #5
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    Unhappy

    Isn't there some method of checking for a current instance of an executable and someway referencing that object.

  6. #6
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    What I gave you will prevent the second instance from opening. If you want to notify the user and activate the previous instance, you can use:
    Code:
    If App.PrevInstance = True Then
       'Insert Msgbox for Notification if Needed
       AppActivate ("Untitled - Notepad")  'Replace with your App's Window Title
       Unload Me
       End
    End If
    Wade

  7. #7
    Addicted Member Dim A's Avatar
    Join Date
    Jul 2000
    Posts
    201

    Isn't there a way?

    Isn't there a way to make it so that the current object does a certain action... i.e. maximize, or become on top, etc... Would you have to use sendMessage somehow to get this type of functionality?

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    10
    wade it works great it loads the app one time only. thanks

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