Make your own free website on Tripod.com

Arabic Menu


To make a form fully Arabic you need to change the orientation of the menu from Left to Right, the following code make the menu viewed from the right.


code for Arabic Menu:

procedure TForm1.Button1Click(Sender: TObject);
var
 mii: TMENUITEMINFO;
 szBuffer: array[0..80] of char;
begin
   // Get the original value of mii.fType first
   // and OR that with MFT_RIGHTORDER
   mii.cbSize := sizeof (TMENUITEMINFO);
   mii.fMask := MIIM_TYPE;
   mii.dwTypeData:= szBuffer;
   mii.cch   := sizeof (szBuffer);

   GetMenuItemInfo(MainMenu1.handle, 0, TRUE, mii);

   // OR in MFT_RIGHTORDER type
   mii.fMask := MIIM_TYPE;
   mii.fType  := mii.fType or MFT_RIGHTORDER;

   // Right order the menu
   SetMenuItemInfo(MainMenu1.handle, 0, TRUE, mii);
   DrawMenuBar(handle);
end;
 
BACK