Firstly, we need to create a new plugin. From the plugin maintenance form, select the New record tool.
Don't modify the existing code, just scroll right to the bottom of the existing code and paste the following code in
- Code: Select all
Partial Class LaunchApp
Inherits JiwaFinancials.Jiwa.JiwaApplication.ProcessAction.UserInterface
Public Sub New()
Dim notepad As System.Diagnostics.Process = System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo("notepad.exe"))
End Sub
Public Overrides Sub Start()
End Sub
End Class
Enter in a plugin name and description, check the enabled checkbox.
The form should like this :
Save the new plugin and now open the Forms maintenance form. In here we need to define a new form, linking it to the newly created plugin.
At the bottom "template" row of the forms grid, select the Form Type combo box and select plugin.
Then choose the Assembly using the lookup button next to the Assembly Full Name column. Because we used a type of Plugin, and not Form - the Assembly lookup button loads a search window prompting us to choose which plugin to use.
Choose the new plugin, and then in the class name drop down, choose the "LaunchApp" class from the list. Give the form a description of "Launch App" and then save.
Now we have defined a form, we need to add it to a menu. Open the menu maintenance form and locate the "Launch App" form from the list, and drag onto the menu. In this case we want to add it to the "Samples" folder under the Plugins folder.
Save and the menu will refresh. Test the new menu option by locating the "Launch App" menu option and selecting it. The notepad application should appear as follows:
If you want to pass arguments to the application being launched, this is possible - explore the .NET documentation on System.Diagnostics.Process to see how.