Jump to content

Any way to ignore WM_CLOSE ?


Recommended Posts

Posted

Hello,

does anyone knows a way of telling a running program to ignore the WM_CLOSE message?

I need this for one of our Server Application which is running with about 30 open Command Boxes - and i want to prevent anyone from klicking the "X" accidently.

Bye,

Egon


Posted (edited)

hello,

I think you should hide them with the CMDOW utility ( link on MSFN , direct link ).

Else, the only way I know is to code a program that will find the handle to each command windows, then subclass them to trap the WM_CLOSE... not sure that will be easy to do with these windows, since they are a bit "specials"...

(another solution would be to modify the system menu to disable to close button -- much more elegant... more complex too)

bye

EDIT: links

Edited by Delprat
Posted

Hi,

thanks for your reply.

i've found a tool called "noclose.exe" which hides all close options from a open command line window.

The tool itself is attached to this message.

Bye, Egon

noclose.exe

Posted

You're welcome !... and you've found the elegant one ;)

How it works ? (is it "hardcoded" window title or commandline or by process name or ... ?)

bye

Posted

Hi,

no it works by retrieving the window handle of the current command line window and deleting the proper Items from the Menu (DeleteMenu)

Bye, Egon

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...