#define INCLUDE_SUBMENUS 1

#define MIA_DISABLED_ON  MIA_DISABLED
#define MIA_DISABLED_OFF 0

HWND Frame_window = ...
HWND SysMenu_window = WinWindowFromID (Frame_window, FID_SYSMENU);

WinSendMsg (SysMenu_window, MM_SETITEMATTR,                            
                            MPFROM2SHORT (                             
                                           SC_CLOSE,                   
                                           INCLUDE_SUBMENUS            
                                         ),                            
                            MPFROM2SHORT (                             
                                           MIA_DISABLED,               
                                           MIA_DISABLED_ON
                                         ));
