June 10th, 2003, 03:52 AM
Dos box woes
Hi does anyone know a way or even have some code lying around (C++/C) that would allow me to set up a dos box that cannot be terminated?
im working with windows 2000 and was asked to figure out how to make this happen and the long and short of it is i cant.
Please help all replies will be appreciated.
June 10th, 2003, 09:51 AM
Any process that is running on a windows machine can be shutdown, be this through the task manager or through right clicking on the application title bar, or even sometimes just by clicking the close button (X) on the dos box.
The only other thing you could really do is have another application (service maybe) running that is watching for this application and if it doesn't see it, then it starts it back.
June 10th, 2003, 10:59 AM
I'm guessing that there should be something in the Console API, but I couldn't find it. Kind of like how you can set a window's properties to enable or disable the exit button.
There's a lot of Win32 Visual C++-specific brainpower over in CodeGuru's fora, so you might try there as well: http://www.codeguru.com/forum/
BTW, you might want to be a bit more specific about what you are trying to do. At first, I misinterpreted your question as the perennial one from those who launch their DOS program directly from the VC++ IDE but cannot read the output because the DOS window (AKA "console") close immediately after their program terminates.
June 10th, 2003, 01:01 PM
i understand that clarification should have been initialy made. i felt that my initial post was highly vague so ill tell you what i am supposed to be acheiving.
i need a dos box to stay open because its going to display a list of policies on internet usage, its for a voluntry organisation that has a small network of computers for young people to use to find information on various youth related issues. the need for a policies box had been brought up through misuse of the internet. we use filters but as you must all be aware these are less than perfect and do absolutely nothing tow\ards peer to peer filesharing etc.
so i just need a list of policies to be displayed at all times to act as a general warning and code of conduct. so as you can see this cant be killed, im not woried at this point on anythiing fancy just a working model would be fine but i dont understand the windows api all that well therefore dont know how to acheive it, i nievely figured there would be some kind of magic solution consisting of a few lines of code that would allow this to take place and even better allow it to be killed through a combination of key presses say ctrl+ whatever i could even set up a simple password system.
the only real problem im facing is keeping the box open constantly.
hope this clarifies my issue in a little more depth.
thanks for your time...........
June 10th, 2003, 03:30 PM
OK, I assume that this will be on a Windows system and that you normally write Windows applications. Also, I assume that this is not part of another program, but rather is to be a separate application.
Why not write a dialog-based app? You can define the border properties so that it does not have the corner buttons (or else will disable them) and you can make sure that you don't put any OK or Cancel buttons on it. If it needs to be visible at all times, including on top of the current application, then you should be able to set the Z-axis property to always keep it on top. The same thing can be done within an application by using a modeless dialog.
The policy statement can be placed on the dialog as label controls or else, if the list is too long, then a scrollable listbox could be placed on the dialog and the policy statement inserted into it.
Does that sound like what you need?
June 11th, 2003, 08:48 AM
that sounds spot on, exactly what i need eccept for the always on top which means i dont even need to go there, its a win2k environment the organisation uses so would there be a way to utilise alpha blending into it to make it semi transparent?
June 11th, 2003, 11:37 AM
You just went beyond my experience with alpha-blending. I would imagine that it should work. And even if you can't get a dialog app to work, there might be a way to display an alpha-blended graphic that contains the policy.
You should probably post this in a new thread as a new question. It might also be a good idea to post it in CodeGuru as well, since this sounds a bit more specialized -- see my previous post for the link.
June 12th, 2003, 02:44 PM
Something past dwise's knowledge? What is the world coming to?
June 12th, 2003, 03:08 PM
Oh, there's lots that I'm ignorant of. For instance, My C++ training and most of my C++ experience predate the new language standard (1998, I think that was finalized) and there's lots about the changes that I haven't learned yet.
I've been learning a lot from the questions posted on this forum. I've even been able to answer an number of those questions simply by looking it up. My UNIX instructor tried to teach the class what I'd already learned, how to find the answers when questions arise. It's usually just that my general knowledge and experience suggest what kind of solution is needed and where to start looking for it. It's kind of like how I used to irritate my wife by coming up with the right question while watching Jeopardy, then commenting truthfully, "I didn't know that." I didn't, but the answer and the category would lead me to the question, more often than not.
June 12th, 2003, 03:10 PM
pretty much just general logic ;)