stop multi instantes of program on one machine

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • id10t error

    stop multi instantes of program on one machine

    Hi,

    I am sorry that my description is not better but it is hard to think
    of one for this problem. I have a program on the user computer and I
    need to only let them have one instants of this program open at one
    time. Is there a way to check to see if the program in already running
    and not let them open it?

    Thank you in advance for your help.
  • rowe_newsgroups

    #2
    Re: stop multi instantes of program on one machine

    On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
    Hi,
    >
    I am sorry that my description is not better but it is hard to think
    of one for this problem. I have a program on the user computer and I
    need to only let them have one instants of this program open at one
    time. Is there a way to check to see if the program in already running
    and not let them open it?
    >
    Thank you in advance for your help.
    There is a setting on the application's property pages called "Single
    Instance Application" or something similar - you should check that
    option.

    Thanks,

    Seth Rowe [MVP]

    Comment

    • Michel Posseth  [MCP]

      #3
      Re: stop multi instantes of program on one machine


      Seth

      I believe this option was introduced in the 2005 version of VS ( i use 2008
      now so can`t check that for sure )

      if the TS is using a version < 2005 of VS he migh investigate the diverse
      postings that use a Mutex

      see for instance http://www.freevbcode.com/ShowCode.Asp?ID=5845
      or my own version :-) wich is Terminal server proof


      HTH

      Michel

      "rowe_newsgroup s" <rowe_email@yah oo.comschreef in bericht
      news:29fd64db-63f5-4019-82a7-ae77ef38ec35@x3 5g2000hsb.googl egroups.com...
      On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
      >Hi,
      >>
      >I am sorry that my description is not better but it is hard to think
      >of one for this problem. I have a program on the user computer and I
      >need to only let them have one instants of this program open at one
      >time. Is there a way to check to see if the program in already running
      >and not let them open it?
      >>
      >Thank you in advance for your help.
      >
      There is a setting on the application's property pages called "Single
      Instance Application" or something similar - you should check that
      option.
      >
      Thanks,
      >
      Seth Rowe [MVP]

      Comment

      • id10t error

        #4
        Re: stop multi instantes of program on one machine

        On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
        On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
        >
        Hi,
        >
        I am sorry that my description is not better but it is hard to think
        of one for this problem. I have a program on the user computer and I
        need to only let them have one instants of this program open at one
        time. Is there a way to check to see if the program in already running
        and not let them open it?
        >
        Thank you in advance for your help.
        >
        There is a setting on the application's property pages called "Single
        Instance Application" or something similar - you should check that
        option.
        >
        Thanks,
        >
        Seth Rowe [MVP]
        Seth,

        That worked great. Thank you for your help

        Comment

        • kimiraikkonen

          #5
          Re: stop multi instantes of program on one machine

          On May 1, 6:05 pm, id10t error <tubbz...@gmail .comwrote:
          On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
          >
          >
          >
          On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
          >
          Hi,
          >
          I am sorry that my description is not better but it is hard to think
          of one for this problem. I have a program on the user computer and I
          need to only let them have one instants of this program open at one
          time. Is there a way to check to see if the program in already running
          and not let them open it?
          >
          Thank you in advance for your help.
          >
          There is a setting on the application's property pages called "Single
          Instance Application" or something similar - you should check that
          option.
          >
          Thanks,
          >
          Seth Rowe [MVP]
          >
          Seth,
          >
          That worked great. Thank you for your help
          Hi,
          You can also check this out:


          or it can be done by querying application's current entity using
          process class.

          Thanks,

          Onur

          Comment

          • Tom Shelton

            #6
            Re: stop multi instantes of program on one machine

            On 2008-05-01, kimiraikkonen <kimiraikkonen8 5@gmail.comwrot e:
            On May 1, 6:05 pm, id10t error <tubbz...@gmail .comwrote:
            >On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
            >>
            >>
            >>
            On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
            >>
            Hi,
            >>
            I am sorry that my description is not better but it is hard to think
            of one for this problem. I have a program on the user computer and I
            need to only let them have one instants of this program open at one
            time. Is there a way to check to see if the program in already running
            and not let them open it?
            >>
            Thank you in advance for your help.
            >>
            There is a setting on the application's property pages called "Single
            Instance Application" or something similar - you should check that
            option.
            >>
            Thanks,
            >>
            Seth Rowe [MVP]
            >>
            >Seth,
            >>
            >That worked great. Thank you for your help
            >
            Hi,
            You can also check this out:

            >
            or it can be done by querying application's current entity using
            process class.
            >
            Thanks,
            >
            Onur
            Another process name method... I always try to warn people off of this
            method. It's just as easy to use a mutex and less dangerous. I know
            the chance is small - but process names are not necessarily unique.
            There is nothing stopping me from creating an application names
            notepad.exe. If I were to use this method, then if the user starts the
            real notepad, they can't start mine. I know that's extreme and
            contrived - but, it isn't an impossible situation. Using a named mutex,
            is generally a safer way to go.

            --
            Tom Shelton

            Comment

            • kimiraikkonen

              #7
              Re: stop multi instantes of program on one machine

              On May 1, 7:01 pm, Tom Shelton
              <tom_shel...@YO UKNOWTHEDRILLco mcast.netwrote:
              On 2008-05-01, kimiraikkonen <kimiraikkone.. .@gmail.comwrot e:
              >
              >
              >
              On May 1, 6:05 pm, id10t error <tubbz...@gmail .comwrote:
              On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
              >
              On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
              >
              Hi,
              >
              I am sorry that my description is not better but it is hard to think
              of one for this problem. I have a program on the user computer and I
              need to only let them have one instants of this program open at one
              time. Is there a way to check to see if the program in already running
              and not let them open it?
              >
              Thank you in advance for your help.
              >
              There is a setting on the application's property pages called "Single
              Instance Application" or something similar - you should check that
              option.
              >
              Thanks,
              >
              Seth Rowe [MVP]
              >
              Seth,
              >
              That worked great. Thank you for your help
              >
              Hi,
              You can also check this out:
              http://www.bobpowell.net/singleinstance.htm
              >
              or it can be done by querying application's current entity using
              process class.
              >
              Thanks,
              >
              Onur
              >
              Another process name method... I always try to warn people off of this
              method. It's just as easy to use a mutex and less dangerous. I know
              the chance is small - but process names are not necessarily unique.
              There is nothing stopping me from creating an application names
              notepad.exe. If I were to use this method, then if the user starts the
              real notepad, they can't start mine. I know that's extreme and
              contrived - but, it isn't an impossible situation. Using a named mutex,
              is generally a safer way to go.
              >
              --
              Tom Shelton
              Tom,
              That's a good point, blocking an application by its name can cause
              conflicts with the applications that have the same name, though it's
              not common but possible as you stated.

              Also another point might be, the user can start application by
              changing application name before launch, so this way(GetProcessB yname)
              won't avoid your application to be executed more than once by a
              clever user.

              Thanks :)

              Onur

              Comment

              • Michel Posseth  [MCP]

                #8
                Re: stop multi instantes of program on one machine


                "kimiraikko nen" <kimiraikkonen8 5@gmail.comschr eef in bericht
                news:70a787d1-ffe7-407f-aca0-224690446426@a2 3g2000hsc.googl egroups.com...
                On May 1, 7:01 pm, Tom Shelton
                <tom_shel...@YO UKNOWTHEDRILLco mcast.netwrote:
                >On 2008-05-01, kimiraikkonen <kimiraikkone.. .@gmail.comwrot e:
                >>
                >>
                >>
                On May 1, 6:05 pm, id10t error <tubbz...@gmail .comwrote:
                >On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
                >>
                On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
                >>
                Hi,
                >>
                I am sorry that my description is not better but it is hard to
                think
                of one for this problem. I have a program on the user computer and
                I
                need to only let them have one instants of this program open at
                one
                time. Is there a way to check to see if the program in already
                running
                and not let them open it?
                >>
                Thank you in advance for your help.
                >>
                There is a setting on the application's property pages called
                "Single
                Instance Application" or something similar - you should check that
                option.
                >>
                Thanks,
                >>
                Seth Rowe [MVP]
                >>
                >Seth,
                >>
                >That worked great. Thank you for your help
                >>
                Hi,
                You can also check this out:
                >http://www.bobpowell.net/singleinstance.htm
                >>
                or it can be done by querying application's current entity using
                process class.
                >>
                Thanks,
                >>
                Onur
                >>
                >Another process name method... I always try to warn people off of this
                >method. It's just as easy to use a mutex and less dangerous. I know
                >the chance is small - but process names are not necessarily unique.
                >There is nothing stopping me from creating an application names
                >notepad.exe. If I were to use this method, then if the user starts the
                >real notepad, they can't start mine. I know that's extreme and
                >contrived - but, it isn't an impossible situation. Using a named mutex,
                >is generally a safer way to go.
                >>
                >--
                >Tom Shelton
                >
                Tom,
                That's a good point, blocking an application by its name can cause
                conflicts with the applications that have the same name, though it's
                not common but possible as you stated.
                >
                Also another point might be, the user can start application by
                changing application name before launch, so this way(GetProcessB yname)
                won't avoid your application to be executed more than once by a
                clever user.
                >
                Thanks :)
                >
                Onur


                Onur

                If you would have clicked on my example ( the second link that is
                Terminal server capable ) you would have seen that there is a simple
                solution for that problem
                instead of creating a mutex by name you create one by application GUID


                HTH

                Michel


                Comment

                • Mayur H Chauhan

                  #9
                  Re: stop multi instantes of program on one machine

                  Here we have one catch. Checking the Checkbox of single instance would work
                  fine for Single login machine. In case of machines (OS) where multiple user
                  can login at same time, this won't work. This checkbox setting works for
                  that that login. If other user login on same machine, then there is
                  possiblity that second instance can start of same application.

                  Thanks,
                  Mayur H Chauhan

                  "Tom Shelton" <tom_shelton@YO UKNOWTHEDRILLco mcast.netwrote in message
                  news:eKuDRS6qIH A.4928@TK2MSFTN GP04.phx.gbl...
                  On 2008-05-01, kimiraikkonen <kimiraikkonen8 5@gmail.comwrot e:
                  >On May 1, 6:05 pm, id10t error <tubbz...@gmail .comwrote:
                  >>On May 1, 9:30 am, rowe_newsgroups <rowe_em...@yah oo.comwrote:
                  >>>
                  >>>
                  >>>
                  >On May 1, 9:17 am, id10t error <tubbz...@gmail .comwrote:
                  >>>
                  >Hi,
                  >>>
                  >I am sorry that my description is not better but it is hard to think
                  >of one for this problem. I have a program on the user computer and I
                  >need to only let them have one instants of this program open at one
                  >time. Is there a way to check to see if the program in already
                  >running
                  >and not let them open it?
                  >>>
                  >Thank you in advance for your help.
                  >>>
                  >There is a setting on the application's property pages called "Single
                  >Instance Application" or something similar - you should check that
                  >option.
                  >>>
                  >Thanks,
                  >>>
                  >Seth Rowe [MVP]
                  >>>
                  >>Seth,
                  >>>
                  >>That worked great. Thank you for your help
                  >>
                  >Hi,
                  >You can also check this out:
                  >http://www.bobpowell.net/singleinstance.htm
                  >>
                  >or it can be done by querying application's current entity using
                  >process class.
                  >>
                  >Thanks,
                  >>
                  >Onur
                  >
                  Another process name method... I always try to warn people off of this
                  method. It's just as easy to use a mutex and less dangerous. I know
                  the chance is small - but process names are not necessarily unique.
                  There is nothing stopping me from creating an application names
                  notepad.exe. If I were to use this method, then if the user starts the
                  real notepad, they can't start mine. I know that's extreme and
                  contrived - but, it isn't an impossible situation. Using a named mutex,
                  is generally a safer way to go.
                  >
                  --
                  Tom Shelton

                  Comment

                  Working...