Thread: An application that starts itself after existing

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    35

    An application that starts itself after existing

    I'm writing an application which needs to do some file operations, exist and the start again. The application must exist completely in order to free all the resources (files including itself, etc.) that it is using. How can I achieve this? How can I tell Windows, programatically, that the application must start again after existing completely?

  2. #2
    Registered Trademark
    Join Date
    Apr 2005
    Posts
    19
    do u mean as in start another instance of the program during runtime?

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    You should be freeing all resources your program uses yourself when you're done with them, the only thing you can't do is unload your executable without exiting.
    If you realy want to do this you can either start a new instance and then exit or create a seperate program to start your main program at a certain time.

  4. #4
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    I don’t think it's possible to completely close a program all of the way, and then start it back up again on it's own. Once something is dead, it's dead until something else brings it back so I have an idea, why don't you make your program open a small program, then your program closes it's self. Then the small program opens your program, and then the small program closes it's self too. Thus leaving thing back the way they where, just your program was refreshed.

  5. #5
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227
    ...or just do what quantum said and have the program start it self again (so there are 2 of the same program running) and then just close the first one. . .that way its only a couple lines longer
    Keyboard Not Found! Press any key to continue. . .

  6. #6
    Chief Code Coloniser!
    Join Date
    Apr 2005
    Posts
    121
    Sounds kinda "virusy" to me Or is this for self-update/patching?

  7. #7
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    dit6a9 this type of action does sound suspicious so please explain what it is you are trying to do and why. I'd suggest doing it quickly

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using iproute2 existing code for my application
    By kky in forum C Programming
    Replies: 1
    Last Post: 10-10-2007, 01:27 PM
  2. Problem with com application
    By amardon in forum C++ Programming
    Replies: 3
    Last Post: 10-06-2005, 05:50 AM
  3. MFC run application by clicking on file...
    By dug in forum Windows Programming
    Replies: 4
    Last Post: 12-02-2004, 04:33 AM
  4. Win application not very portable
    By swed in forum Windows Programming
    Replies: 5
    Last Post: 10-01-2001, 11:17 AM