问题
I have done research and I haven't found solution for my problem. Is there any good way, to disable minimize, maximize and close buttons in Win32 ? I want them to be still present and animating but not sensitive. I want also to be able to resize the window by dragging the frame.
回答1:
Simply capture the relevant events (WM_SYSCOMMAND and WM_CLOSE), and tell Windows to ignore them by returning 0. Please note that in case of WM_SYSCOMMAND, you should only do this for events you really want to block, i.e. event codes SC_MINIMIZE, SC_MAXIMIZE, etc. All others should be allowed to pass through normally. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646360%28v=vs.85%29.aspx for more information.
However, please consider that if you provide the buttons, users will expect them to work. Just hiding them may be a better choice. This is something you can do by calling SetWindowLong (https://msdn.microsoft.com/en-us/library/ms633591%28v=vs.85%29.aspx), and change the GWL_STYLE attribute so it no longer includes WS_MINIMIZEBOX, WS_MAXIMIZEBOX, etc. flags.
来源:https://stackoverflow.com/questions/36113675/disable-minimize-maximize-close-buttons-in-win32