CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    37

    About opening exe

    Is there is any way to open the exe(executable) only once. when tried to open the exe next time it should not be opened.

  2. #2
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: About opening exe

    FindWindow is what u want .
    Little by little one goes far
    Keep moving.......!
    Nothing is impossible !

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: About opening exe

    Quote Originally Posted by sunny_sz
    FindWindow is what u want .
    Wrong!

    The correct way is described in J.Newcomer's essay Avoiding Multiple Instances of an Application
    Last edited by VictorN; September 7th, 2007 at 07:22 AM.
    Victor Nijegorodov

  4. #4
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: About opening exe

    Quote Originally Posted by VictorN
    Wrong!

    The correct way is decribed in J.Newcomer's essay Avoiding Multiple Instances of an Application
    I wanna know why that is wrong ?? Pls. advise !
    Little by little one goes far
    Keep moving.......!
    Nothing is impossible !

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: About opening exe

    Joe Newcomer described it very good in the essay I referred to in my previous post.
    Is it so hard to read it?

    PS.
    OK, the simplest example: application is windowless.
    More complicated example: application needs (for some reasons) some time to create the main window, and during this time period user started this application again.
    Victor Nijegorodov

  6. #6
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: About opening exe

    But what veerakalai want is that when a window(e.g. a .exe file is running) is running , if user open it again , it should not be opened again, I mean , by using findwindow function, we may find this window of this .exe file and check whether this file is running or not , if we find this handle of this window, we can prevent it opened again, right ??
    Little by little one goes far
    Keep moving.......!
    Nothing is impossible !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured