Create single instance applications linked to associated file types. When the associated file is double clicked it will be handled by a single instance of your application.
This lets your application act like Media Player rather than Notepad. Each time you double click a media file Media Player does not open a new window but re-uses the existing one.
This is normally difficult to achieve in Visual Basic but the OneOnly control makes it simple and also allows you to create the associations between file types and your application.
Extending the association allows you to add items to the right click pop-up context menu for your associated file types as well.
To achieve this you just need to drop this control on your main form and in the form load event check the AlreadyExists property. If this is True then you need to exit your application.
If all is well then you can use the CreateAssociation and CreateAdditionalAssociation methods to define the file types that are linked to your application.
A NewCommand event is raised in your application whenever an associated file type is launched. You can then examine the passed command line and handle the file in the original instance of your application.
# Handle multiple files with a single instance of your application just like Windows Media Player.
# Raises an event when an associated file type is launched.
# Built in methods to associate file types and add items to the right click pop-up context menu for your created file types.
# The OneOnly control mechanisms are fully debuggable within the VB IDE.
# Download includes full install and uninstall and example project for Visual Basic 6.
# Online HTML Help is fully integrated into the Visual Basic IDE.
# Operates in Freeware mode when not registered. Fully working control while unregistered except no file associations can be made using the control. Your application can associate files and then use the single instance magic that this control offers. When you want all the functionality in one place just register.
Microsoft Visual Basic 6.0