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. Run single instance of an application

Run single instance of an application

Scheduled Pinned Locked Moved Windows Forms
csharpquestion
3 Posts 3 Posters 0 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.
  • A Offline
    A Offline
    ashok_rgm
    wrote on last edited by
    #1

    Hi all, I have created windows application in c#, it is Sample.exe, If this exe is already running, andmeanwhile if double click and initiate one more instance of Sample.exe it should point to already running Sample.exe. Concept is simple if my windows media player is running say a movie file is being run. and if I launch media player from shortcut it will still show the already running one instead of opening the separate media player. Is it possible to do so for my application, how can I apply same logic to my Sample.exe Thanks,

    ashok

    L G 2 Replies Last reply
    0
    • A ashok_rgm

      Hi all, I have created windows application in c#, it is Sample.exe, If this exe is already running, andmeanwhile if double click and initiate one more instance of Sample.exe it should point to already running Sample.exe. Concept is simple if my windows media player is running say a movie file is being run. and if I launch media player from shortcut it will still show the already running one instead of opening the separate media player. Is it possible to do so for my application, how can I apply same logic to my Sample.exe Thanks,

      ashok

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Something like this[^]? How about this[^]?

      1 Reply Last reply
      0
      • A ashok_rgm

        Hi all, I have created windows application in c#, it is Sample.exe, If this exe is already running, andmeanwhile if double click and initiate one more instance of Sample.exe it should point to already running Sample.exe. Concept is simple if my windows media player is running say a movie file is being run. and if I launch media player from shortcut it will still show the already running one instead of opening the separate media player. Is it possible to do so for my application, how can I apply same logic to my Sample.exe Thanks,

        ashok

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #3

        Here you are: Single Instance Application, Passing Command Line Arguments[^]

        Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

        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