change new form in winforms process running by user
-
hello I have a viewer that displays image files in wimforms. I run it from another external software and pass it file data for display in parameters to main args[]. Every time when I call the viewer I want to open the same process in order to immediately open the viewer and not close and restart. I successful to identify the current running process and also enlarge the same Form window, but I don't know how to perform show new Form again, So that the viewer will update the view with new files. I mean , i have current class Process . but i need to execute Application.Run(new Form) but for current process
-
hello I have a viewer that displays image files in wimforms. I run it from another external software and pass it file data for display in parameters to main args[]. Every time when I call the viewer I want to open the same process in order to immediately open the viewer and not close and restart. I successful to identify the current running process and also enlarge the same Form window, but I don't know how to perform show new Form again, So that the viewer will update the view with new files. I mean , i have current class Process . but i need to execute Application.Run(new Form) but for current process
You don't need to run Application.Run again. What you do need to do is setup some kind of communication channel where the first instance of your app is listening for messages from a second instance. You can launch a second instance of your display app and when it detects that the first instance is already running, send a message over the channel so the first instance can be told what to do, like load a different file and display it. One method of doing this is to use IpcChannel[^] You can use a Mutex[^] to determine if your app is already running.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
You don't need to run Application.Run again. What you do need to do is setup some kind of communication channel where the first instance of your app is listening for messages from a second instance. You can launch a second instance of your display app and when it detects that the first instance is already running, send a message over the channel so the first instance can be told what to do, like load a different file and display it. One method of doing this is to use IpcChannel[^] You can use a Mutex[^] to determine if your app is already running.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiakthanks