restart an application - Windows CE

This is a discussion on restart an application - Windows CE ; Hi, on linux, the functions exec* replace the current process by another process. I would like to know if there is something equivalent for Windows CE. I've looked at the doc of Process and thread (http:// msdn.microsoft.com/en-us/library/aa908727.aspx) but I have ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: restart an application

  1. restart an application

    Hi,

    on linux, the functions exec* replace the current process by another
    process. I would like to know if there is something equivalent for
    Windows CE. I've looked at the doc of Process and thread (http://
    msdn.microsoft.com/en-us/library/aa908727.aspx) but I have not found
    something similar. My final purpose is to write a function that restart
    the application (that's what execvp is mainly used for).

    thank you

  2. Re: restart an application

    Torri wrote:
    > on linux, the functions exec* replace the current process by another
    > process. I would like to know if there is something equivalent for
    > Windows CE.


    No. You can not (or, well, at least not easily) load another executable into
    the current process and execute it. What you can do is create a new process
    with the executable and terminate the current process.

    > I've looked at the doc of Process and thread (...) but I have not found
    > something similar. My final purpose is to write a function that restart
    > the application (that's what execvp is mainly used for).


    I'd use GetModuleFileName() to find the path to the current process, call
    CreateProcess() with it and then TerminateProcess() to just terminate the
    current process.

    HTH

    Uli

    --
    Sator Laser GmbH
    Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932


+ Reply to Thread