preventing double application launch

Discussion in 'Questions (Windows Mobile)' started by Put Claude, Oct 2, 2007.

  1. Put Claude

    Put Claude Active Member Licensed User


    Can 't find the way preventing a double application launch...
    can you help me out...

    Great forum guys, never get one like this, all my deep respects...

    Put Claude Belgium
  2. Erel

    Erel Administrator Staff Member Licensed User

    The .Net CF does (suppose to) prevent more than single instance.
    How do you get more than one instance?
  3. dzt

    dzt Active Member Licensed User

    I think, he is talking about desktop.

    You can check your Form Title, and if it exists then quit the app.
    You can do that using my dzHWdesktop.dll (latest version) posted here

    [FONT=Courier New][COLOR=#0000ff]Sub [/COLOR][/FONT]Globals
    #0000ff]End Sub
    Sub [/COLOR]App_Start

    #0000ff]  If[/COLOR] dzhw.GetWindowHandle([COLOR=#800000]"null"[/COLOR], [COLOR=#800000]"Form Title"[/COLOR]) > [COLOR=#800080]0[/COLOR] [COLOR=#0000ff]Then
    #0000ff]    AppClose
    #0000ff]  End[/COLOR] [COLOR=#0000ff]If
    [/COLOR]  Form1.Show
    #0000ff]End Sub
  4. Put Claude

    Put Claude Active Member Licensed User


    Yes, did get 2 instance on Acer 300 WM5...
    Noticed it when my gps-program counted every 2 seconds, I quit the program and get the underlying second same program that counts now every second, so... for some reason, the system did not prevent a second instance at same time.

    did not find that in helpfile: dzhw.GetWindowHandle("null", "Form Title")

    Made a little WF.exe in C (window find) that checks if my application already is open, so yes, bring it to front, and cancel the second launch.
    My solution: Start this little exe with the shell function as first line in my application...

    Put Claude Belgium
    Last edited: Oct 2, 2007
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice