in my application, I registered a file type (.asm) with my application (this is a tabbed notebook application), and when these files are double-clicked, they open with my application through the arguments passed at startup:
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Main(args)); }
Now the problem is that, although it works, if one instance of my application is already running, whenever a file is opened, a new instance is created, and not a new tab opened in the current instance, I donβt want to. So I decided to check if the program is running, and if so, I would call a separate function in the main form to load this document. But the problem is that I do not know how you call the function in Main.cs from Program.cs, how do we do it?
source share