M
M
Maxim Romashko2017-09-04 22:06:16
C++ / C#
Maxim Romashko, 2017-09-04 22:06:16

How to disable close button?

Please tell us how to do this, do I need to make the close button, which is located along with minimize and expand, inactive, via WinApi? And does it work in windows 8?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrei Smirnov, 2017-09-04
@md5inj

Not sure about Windows 8 but give it a try..

void DisableCloseButton(HWND hwnd)
{
    EnableMenuItem(GetSystemMenu(hwnd, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question