Tech Support > Microsoft Windows > Disabling abililty to close DOS window with "X"
Disabling abililty to close DOS window with "X"
Posted by Steve on February 15th, 2006


I have a special DOS program running on Windows XP and when my users close
the program with the "X" on the title bar it causes lots of issues. Is there
away to disable the "X"?

Thanks for any suggestions.

Posted by Phil Robyn on February 15th, 2006


Steve wrote:

Why don't you just run it minimized?

--
Phil Robyn
University of California, Berkeley

Posted by Jon on February 15th, 2006



"Steve" <Steve@discussions.microsoft.com> wrote in message
news:6E822C59-3EB1-4A89-B0DD-459D4EE98FC9@microsoft.com...
You could run the program "invisibly" eg by having another program start it
invisibly eg using a vbscript "wrapper" [WshShell "Run" method]

Alternatively, if you need some kind of user interaction, and you have
access to a package, that can enable you to create a small dialog, such as
Visual Basic, Visual C++, Visual Studio, then that is something you can
readily disable in your own custom dialog.

Jon


Posted by Steve on February 15th, 2006


This program needs to be used by the users. It is a POS sales program. But it
needs to be exited by having the user escape out. When they close it using
the X it causes errors in the database file.

"Jon" wrote:

Posted by Jon on February 15th, 2006


Another alternative might be to run it in "Full screen mode"
Adding DWORD value key of name "FullScreen" and value 1
at HKEY_CURRENT_USER\Console, causes cmd.exe to open up full screen.
(Changing that value to 0, causes cmd.exe to open up normally)

eg
cmd /k programname.exe

after making the above change
(Type exit or ALT-Enter, or Windowskey-D, Windowskey-M to leave full screen
mode)

Jon


"Steve" <Steve@discussions.microsoft.com> wrote in message
news:B1DBD1CC-0AC7-4FEE-946B-DF29315581B6@microsoft.com...

Posted by Steve on February 15th, 2006


No, can't do that either..they use other programs and they wouldn't handle
getting out of full screen very well...they can't handle closing the program
correctly!! That's why I'm trying to take the ability away from them.

What about hiding the title bar? Is there an easy way to do that maybe?

"Jon" wrote:

Posted by Uwe Sieber on February 16th, 2006



Steve wrote:
I wanted to write such a little tool for a long
time. Not I did and I think I found a volunteer
for testing it :-)

http://www.uwe-sieber.de/files/consolenoclose.zip


Greetings from Germany

Uwe

Posted by Steve on February 21st, 2006


Thank you! It worked excellent!! Nice job!

Steve

"Uwe Sieber" wrote:

Posted by Uwe Sieber on February 22nd, 2006



I've updated the tool yesterday. Now you can use the
commandline parameter /1 to make it disabling the
X button for the next console window it finds and
end then.
Without the parameter it stays in the background and
polls the foreground window for ever.


Greetings from Germany

Uwe


Steve wrote:

Posted by Steve on March 23rd, 2006


Very nice. I've been wanting to play around with learning this myself. What
did you create this in?

Thanks.

"Uwe Sieber" wrote:

Posted by JohnW on March 29th, 2006


This looks like exactly what we want, would it be possible to get the
complete code so we can look at this? We tried compiling the code but
receive errors.

Thank You

"Uwe Sieber" wrote:


Similar Posts