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. .NET (Core and Framework)
  4. how to ban multi-application to run?

how to ban multi-application to run?

Scheduled Pinned Locked Moved .NET (Core and Framework)
tutorialquestion
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.
  • H Offline
    H Offline
    Hesham Yassin
    wrote on last edited by
    #1

    There are certain programs that if we try to run them more than one time by clicking their icon, we get the recent opened one like Winamp or messenger or anti-virus programs. does such programs ban such a thing through the constructor? Thanks, Hesham

    Richard Andrew x64R 1 Reply Last reply
    0
    • H Hesham Yassin

      There are certain programs that if we try to run them more than one time by clicking their icon, we get the recent opened one like Winamp or messenger or anti-virus programs. does such programs ban such a thing through the constructor? Thanks, Hesham

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      The way I prevent more than one instance of my application is to attempt to create a Named Mutex in the startup code. If the mutex already exists, then you know that your application is already running.

      “Cannot find REALITY.SYS...Universe Halted.” ~ God on phone with Microsoft Customer Support

      E 1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        The way I prevent more than one instance of my application is to attempt to create a Named Mutex in the startup code. If the mutex already exists, then you know that your application is already running.

        “Cannot find REALITY.SYS...Universe Halted.” ~ God on phone with Microsoft Customer Support

        E Offline
        E Offline
        E del Ayre
        wrote on last edited by
        #3

        Yes, yes... Using a mutex will be enough for the logic part... Or you could try Process.GetProcesses()... I opted to scan through all the processes so that atleast i can get the hwnd of that process of mine and pop that window out immediately for the user to see...

        think fast, be brave and dont stop.

        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