Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. change new form in winforms process running by user

change new form in winforms process running by user

Scheduled Pinned Locked Moved Windows Forms
csharpwinformstutorialannouncement
3 Posts 2 Posters 21 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 12352206
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • M Member 12352206

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      M 1 Reply Last reply
      0
      • D 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 Kreskowiak

        M Offline
        M Offline
        Member 12352206
        wrote on last edited by
        #3

        thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups