Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages
Started by bar
Fri, 09 May 2008 20:46
restart exe
Author: bar
Date: Fri, 09 May 2008 20:46
Date: Fri, 09 May 2008 20:46
8 lines
953 bytes
953 bytes
Hope everybody well. I want to have a button(Restart exe) on one of my program. Is there any way to restart the application. Thanks for pointer. Thanks SA
Re: restart exe
Author: Ed Mulroy [TeamB]
Date: Fri, 09 May 2008 21:35
Date: Fri, 09 May 2008 21:35
19 lines
1716 bytes
1716 bytes
You can restart by setting all things back to how they were at the beginning and running from where you started. If what you want is to load a new copy of the program and run that then one way is to call CreateProcess to start that new copy, specify a parameter on the command line which tells the program that it is a restart, perhaps giving the HWND of the main window so that the new copy can, once it initializes, place its windows at the same place and send a message to the original which the original will use as a command to end. . Ed > bar wrote in message > news:4824b804@newsgroups.borland.com... > Hope everybody well. > > I want to have a button(Restart exe) on one of my program. > Is there any way to restart the application. > Thanks for pointer.
Re: restart exe
Author: Remy Lebeau (TeamB)
Date: Fri, 09 May 2008 23:02
Date: Fri, 09 May 2008 23:02
15 lines
1659 bytes
1659 bytes
"Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> wrote in message news:4824c3b9$1@newsgroups.borland.com... > perhaps giving the HWND of the main window so that the new copy > can, once it initializes, place its windows at the same place and send > a message to the original which the original will use as a command to end. Alternatively, pass the first instance's process ID as a parameter to the second instance so it can wait for the first instance to full exit before then continuing with its own work. Then the first instance can exit itself once the new process has been created. No sending messages needed. Gambit
Re: restart exe
Author: Boba
Date: Sat, 10 May 2008 07:31
Date: Sat, 10 May 2008 07:31
12 lines
1551 bytes
1551 bytes
smells like you want to kill the application first, and _then_ restart it. if so, make sure you shoot it down completely with no traces left, and re-load it from scratch. Clean up all the unique resources, free up as much memory as possible, release all the system references, reset any hardware in hand, and ... hope for the best. Why do you want to restart it? the way my applications respond to a situation when they have to be restarted is strictly rebooting the system, otherwise you admit your own fault.
Re: restart exe
Author: Alan Bellingham
Date: Sat, 10 May 2008 08:30
Date: Sat, 10 May 2008 08:30
23 lines
1652 bytes
1652 bytes
"Boba" <Boba@somewhere.world> wrote: >Why do you want to restart it? In *my* case, because the logged-in user is changing. The application has a login screen displayed before anything else, and when the program exits, that's when the user is logged out. So, one of my apps does have a restart button on it, in debug mode, so I can quickly log out and come back in as a different user for testing purposes. >the way my applications respond to a situation >when they have to be restarted is strictly rebooting >the system, otherwise you admit your own fault. Sneaky. I shall have to remember that - no more exception throwing, just ExitWindowsEx(). Alan Bellingham -- Team Browns ACCU Conference 2009: to be announced
Re: restart exe
Author: Bruce Salzman
Date: Sat, 10 May 2008 14:41
Date: Sat, 10 May 2008 14:41
17 lines
1556 bytes
1556 bytes
"Alan Bellingham" <alan@lspace.org> wrote in message news:svma24pklguak5h0poo30go83b9mipvmib@4ax.com... > "Boba" <Boba@somewhere.world> wrote: > >>the way my applications respond to a situation >>when they have to be restarted is strictly rebooting >>the system, otherwise you admit your own fault. > > Sneaky. I shall have to remember that - no more exception throwing, just > ExitWindowsEx(). > Pretty much the way Windows used to handle errors. -- Bruce
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads