![]() |
move program console window back
I wrote a C++ program to auto install 2 programs from a CD when it is inserted via an autorun file. I had to make the program pause after initializing the first setup program so that it did not try and run both setups at the same time. When the first program setup starts, the pause command is run in my program bringing it back to an active window and making the setup program inactive. This can be solved simply by clicking on the minimize button, which is fine if I am using the program. I am worried that if someone else uses it they won't know to install both setups. Is there a way to make the console window drop behind the setup window after the pause command is executed?
Any help would be appreciated. Thanks, -BB98 |
how about a batch script, run setup1, then delay, then run setup2?
|
Sorry, I am not sure how to create a batch script. Would you be able to give me some more info, or maybe a link to a tutorial.
This is the code, spaces are just to align the text in the console window to the center. :
# include <stdio.h>thanks, -BB98 |
check out the parameters for the 'cmd' command. Particularly, the /C and /K
system("cmd /C setup.exe"); or system("cmd /K setup.exe"); (btw, a batch script in the simplest form is just a sequence of things you may type at a command shell, the script has a *.bat extension) |
Alright, I'll play with it.
Thanks for the help, -BB98 |
alright, let us know if you still have problems.
|
I still can't get the console window to stop coming to the front on top of the setup program. I would like to learn to create GUI's, maybe this would be a good starting project, any good places to look for tutorials? Or maybe some books?
Thanks in advance, -BB98 |
what have you tried so far?
check here for a relatively decent win32 api tut for gui dev. http://www.functionx.com/win32/index.htm |
I tried playing with the "cmd /C" or "cmd /K" and it worked, except that it would still bring the console window back infront of the first setup program. I think I am going to need to learn a lot more before I can attempt a GUI after browsing through that tut.
Thanks for all the info IR. -BB98 |
Sorry for being impatient... I was looking through my Dev-C++ installed files and came across the Examples folder. After looking through it I found a simple GUI that is along the lines of what I wanted to create to run the series of setup files that way I wanted. The original program had some text in the center and a button towards the bottom that would close the window when clicked. It is supposed to be a simple window that I would like to have several buttons down the center. Each button will correspond to a certain setup.exe file. I have adjusted the code from the example so that it has one button that will execute a setup.exe from the CD-ROM drive. I cannot figure out how to add more buttons for the other setups and one to quit and close the window. If someone could guide me in the right direction on how to add more buttons and where to add it in the code it would help me out a lot. I have looked through a few tutorials, but none so far have mentioned creating or adding buttons to the parent window. Looks like I am going to have to take a trip to Borders and get myself a book...
Here's the code so far. :
/*I am assuming it has something to do with defining more buttons?? Thanks, -BB98 |
| All times are GMT -5. The time now is 11:22 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC