Board index » delphi » how to disable the close button of the window

how to disable the close button of the window

Hi,

I would like to know how to disable only the windows close button (the 'X'
button on the right top of the window).

The BorderStyle property of the TForm seems not to have an appropriate set
of values that suppresses only this button.

Thanks in advance

 

Re:how to disable the close button of the window


On Mon, 19 Oct 1998 14:57:01 -0200, "Djalma Santos"

Quote
<transp...@sol.com.br> wrote:
>I would like to know how to disable only the windows close button (the 'X'
>button on the right top of the window).

Use GetSystemMenu to get a handle to the system menu, then disable the
close menu item.

---
Yorai Aminov (TeamB)
http://ourworld.compuserve.com/homepages/yaminov
(TeamB cannot answer questions received via email.
To contact me for any other reason remove nospam from my address)

Re:how to disable the close button of the window


Quote
> I would like to know how to disable only the windows close button (the 'X'
> button on the right top of the window).

Disable the close box on a form:

  EnableMenuItem( GetSystemMenu( handle, False )
                  SC_CLOSE,
                  MF_BYCOMMAND or MF_GRAYED );                

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitely requested!

Other Threads