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
Printable View
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
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.
Steve Can you tell me the something more about it?
WadeCode:If App.PrevInstance = True Then
Unload Me
End
End If
Isn't there some method of checking for a current instance of an executable and someway referencing that object.
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
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?
wade it works great it loads the app one time only. thanks