shirin71
08-06-2011, 08:59 AM
براي اين كار كافي است كد هاي زير را در OnCreateForm خود قرار دهيد
Code:
procedure TForm1.FormCreate(Sender: TObject);
const
strCLOSE = 'ÎÑæÌ';
strmin='ßãíäå';
strMax='ÈíÔíäå';
strmov='ÌÇÈÌÇíí';
strRes='ÈÇÒÔÊ Èå ÍÇáÊ ÞÈá';
strsiz='ÇäÏÇÒå';
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);
MenuItemInfo.wId := SC_MINIMIZE;
MenuItemInfo.dwTypeData := strmin;
MenuItemInfo.cch := Length(strmin);
SetMenuItemInfo(SysMenu, SC_MINIMIZE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_MAXIMIZE;
MenuItemInfo.dwTypeData := strMax;
MenuItemInfo.cch := Length(strMax);
SetMenuItemInfo(SysMenu, SC_MAXIMIZE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_MOVE;
MenuItemInfo.dwTypeData := strmov;
MenuItemInfo.cch := Length(strmov);
SetMenuItemInfo(SysMenu, SC_MOVE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_SIZE;
MenuItemInfo.dwTypeData := strsiz;
MenuItemInfo.cch := Length(strsiz);
SetMenuItemInfo(SysMenu, SC_SIZE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_RESTORE;
MenuItemInfo.dwTypeData := strRes;
MenuItemInfo.cch := Length(strRes);
SetMenuItemInfo(SysMenu, SC_RESTORE, FALSE, MenuItemInfo);
end;
Code:
procedure TForm1.FormCreate(Sender: TObject);
const
strCLOSE = 'ÎÑæÌ';
strmin='ßãíäå';
strMax='ÈíÔíäå';
strmov='ÌÇÈÌÇíí';
strRes='ÈÇÒÔÊ Èå ÍÇáÊ ÞÈá';
strsiz='ÇäÏÇÒå';
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);
MenuItemInfo.wId := SC_MINIMIZE;
MenuItemInfo.dwTypeData := strmin;
MenuItemInfo.cch := Length(strmin);
SetMenuItemInfo(SysMenu, SC_MINIMIZE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_MAXIMIZE;
MenuItemInfo.dwTypeData := strMax;
MenuItemInfo.cch := Length(strMax);
SetMenuItemInfo(SysMenu, SC_MAXIMIZE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_MOVE;
MenuItemInfo.dwTypeData := strmov;
MenuItemInfo.cch := Length(strmov);
SetMenuItemInfo(SysMenu, SC_MOVE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_SIZE;
MenuItemInfo.dwTypeData := strsiz;
MenuItemInfo.cch := Length(strsiz);
SetMenuItemInfo(SysMenu, SC_SIZE, FALSE, MenuItemInfo);
MenuItemInfo.wId := SC_RESTORE;
MenuItemInfo.dwTypeData := strRes;
MenuItemInfo.cch := Length(strRes);
SetMenuItemInfo(SysMenu, SC_RESTORE, FALSE, MenuItemInfo);
end;