Problem Source: http://www.cnblogs.com/del/archive/2008/06/14/1221980.html#1225922
// In this way, the close button of the current window will be grayed out, but there will be a redundant line var H: hmenu; begin H: = getsystemmenu (handle, false) in the system menu ); deletemenu (H, SC _close, mf_bycommand); end; // The close button of the current window can also be dimmed, and the split line var H: hmenu; begin H: Is also removed: = getsystemmenu (handle, false); deletemenu (h, 6, mf_byposition); deletemenu (H, 5, mf_byposition); end; // This is the method for making the close button of the current MDI child window grayed out (corresponding toCode) Var H: hmenu; begin H: = getsystemmenu (activemdichild. handle, false); deletemenu (h, 6, mf_byposition); deletemenu (H, 5, mf_byposition); end; // This is a method to gray the close button of all MDI subwindows (used in the code corresponding to the MDI form) var H: hmenu; I: integer; begin for I: = 0 to mdichildcount-1 do begin H: = getsystemmenu (mdichil1_[ I]. handle, false); deletemenu (h, 6, mf_byposition); deletemenu (H, 5, mf_byposition); end;