PDA

View Full Version : فارسی کردن منوی سیستمی فرم ها



narsic
دوشنبه 02 دی 1387, 21:36 عصر
فارسی کردن منوی سیستمی فرم ها در دلفی 7
چون که کد واضح هستش توضیحی نمیدم .




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;
*کد رو در رویداد oncreat فرمی قرار بدید که میخواید منوی سیستمیش فارسی بشه .(این کد در حال حاضر برای رویداد OnCreat فرم 1 نوشته شده است )
تصاویر این کار در وبلاگ خودم .
موفق باشید