Hi,
Use the following code to change system menu item text. It works well, but the icon on the left of the item disappeared. The same problem is with AppendMenu function.
Any help?
procedure TForm1.ChangeSystemMenuItemText;
const
strCLOSE = 'Close This Window';
var
SysMenu : HMenu;
MenuItemInfo : TMenuItemInfo;
begin
SysMenu := GetSystemMenu(Handle, FALSE) ;
FillChar(MenuItemInfo,SizeOf(TMenuItemInfo), #0) ;
MenuItemInfo.cbSize := SizeOf(TMenuItemInfo) ;
MenuItemInfo.fMask := MIIM_TYPE or MIIM_ID or MIIM_STATE;
MenuItemInfo.fType := MFT_STRING;
MenuItemInfo.wId := SC_CLOSE;
MenuItemInfo.dwTypeData := strCLOSE;
MenuItemInfo.cch := Length(strCLOSE) ;
SetMenuItemInfo(SysMenu, SC_CLOSE, FALSE, MenuItemInfo) ;
end;
Use the following code to change system menu item text. It works well, but the icon on the left of the item disappeared. The same problem is with AppendMenu function.
Any help?
procedure TForm1.ChangeSystemMenuItemText;
const
strCLOSE = 'Close This Window';
var
SysMenu : HMenu;
MenuItemInfo : TMenuItemInfo;
begin
SysMenu := GetSystemMenu(Handle, FALSE) ;
FillChar(MenuItemInfo,SizeOf(TMenuItemInfo), #0) ;
MenuItemInfo.cbSize := SizeOf(TMenuItemInfo) ;
MenuItemInfo.fMask := MIIM_TYPE or MIIM_ID or MIIM_STATE;
MenuItemInfo.fType := MFT_STRING;
MenuItemInfo.wId := SC_CLOSE;
MenuItemInfo.dwTypeData := strCLOSE;
MenuItemInfo.cch := Length(strCLOSE) ;
SetMenuItemInfo(SysMenu, SC_CLOSE, FALSE, MenuItemInfo) ;
end;