Discussion Locked

Preventing the use of the close button o

0 helpful
24 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I maintain a DOS based application across a large network & running NT workstations. Unfortunately, damage is often caused to the data in this application when a user closes the DOS window in which it runs.
I have managed to configure it to providean "End Task" warning box, but some users just carry on regardless and crash the session.
Does anyone know a way of either removing or disabling the 'X' close function in the top right of the toolbar?

Thanks in anticipation.

24 replies

by syscokid

Don't know how to do that, but we have the exact same problem and our workaround is to modify the shortcut so program runs full-screen.

by miked

It has been a while since I wrote for Dos, but ... Is it an application that you have written at your organization? if so, try this: In MS C, there is (was?) an "at exit" 'function' that lets you 'register' functions to be called when the app closed. I am not sure if that would still b called when the dos window was given a close command, but it's worth a shot.

by parier

Is this DOS prg in a window in NT, can you maximize the window full screen, the borders will disappear and they cannot close it without hiting ALT+TAB, then the "X".

by techrepublic

It seems that I cannot reply to your suggestions without posting it as another answer!

Anyway, thanks for your answers, however, none of them will solve my problem.

Answer 1: Modifying the shortcut will only prevent problems from users who do not know how to / and change the window size. Many of our users prefer to be able to see their icons behind the application. Therefore, they can easily close the window inappropriately. - Thanks anyway.

Answer 2: It's a third party program that I develop but I don't have access to the source code. It's a bit like developing in Access but not being able to re-write the source code for Access itself. - But thanks for the suggestion.

Answer 3: It is run under NT but, like any windows environment, an / will still return it to a window where it can be closed inappropriately. - But thanks!

Anybody got any more suggestions?

Thanks again,

Eddie Palmer.

by scooterg558

After reading your responce to the ideas given, I'd say get with the program, and find another piece of software that will do what this piece does and get rid of this dos based program. Don't get me wrong, I'm a dos guy from ver 3.3 but if you can'tuse the program the way it was meant because you're running in a win environment, and you have users that are closing the sessions then get rid of it. You'll end up spending more time supporting it than you would investigating new solutions.

by techrepublic

Not very helpful suggestion. Some large organisations invest heavily in particular software packages and guys like me have little or no say as to which package to use.

by foxmcf

I work for a software company that has software for the asphalt and aggregate industry accross the nation. We are in the middle of converting our DOS based application to 32 Bit Windows application. Being that the Windows Software is still in its infancy, the software we are shipping switches between DOS and windows screens. Our fleet of programmers have been un-sucessfull in finding away to completely disallow the Close button in a windows 'window'. I know of other companies (certain accounting systems for PC's that have done the same thing we are doing, and were not able to disable the close button).

by nettek

Create a shortcut for the .exe that launches the program. Right-click on the shortcut, and select "Properties". Select the "Screen" tab. Click the option for "Full screen". When the application starts, there will be no "X" or windows menu options, only the options available to the application. You can make a copy of the shortcut and place it on the desktop to make it easier for users to open. If the program is listed under "Start" "Programs", remove the present icon and replace it with the new shortcut.

by nettek

Additionally, if you want to be able to minimize the dos application screen when it is open so that users can use other apps., alt+tab will accomplish this.

by white wolf

Well, if your only problem with it running in fullscreen mode is that the users can use the alt-enter, then go into your .pif file for that app or the dos prompt and go to the misc tab, and clear the keyboard shortcut. (This should stop the users, except those who know about the .pif file! Then it's an issue of locking down their ability to edit the .pif).
- Good Luck!

by techrepublic

This is the closest I think we are going to get!

Thankyou.

I'd also like to thank everyone else for commenting, even though they've not solved the problem.

Thanks. :-)

by jrowland

I can only speak for a Cobol type program running in win 95 enviroment but this may give you some ideas.

Try opening the program and then right clicking on the bar at the top. Try properties, which may be availiable. If it is then choose misc tab and enable close. Change it to disable.

I have no dos level apps right now so I cannot try this unfortunately.

by charley

Having read the other answers, and your replies to them, I can only say this. There is no "perfect solution". Although it has been a while, I once had the same problem. The way I dealt with it was through a combination of the aforementioned workarounds and some "training". Every time someone broke my program, I took longer and longer periods of time to "fix" it. Eventually, other managers started coming to me complaining about the down time. My response was simple..."If your people would quit closing the program inappropriately, this would not happen." Just a few staff meetings later, those incidents started going away. When I left that company, we were down to maybe one call like that per week.

This discussion is closed to new replies.