Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Anwar Nourel
  Where is Anwar Nourel?
 
 Morocco
 Anwar Nourel
 Tags
Subject: RE: Alignment of the menu
Thread ID: 310723 Message ID: 310733 # Views: 34 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Thursday, June 23, 2011 10:06:58 PM         
   


> I develop an application in Arabic. How I may align the menu to the right?


Salam ya si Anwar
try this code. it changes all your vfp to right to left (even menu) .the code restore your first vfp state after.
for a form use form.hwnd instead _vfp.hwnd used here.

*-- Define extended Windows styles
#DEFINE GWL_EXSTYLE -20
#DEFINE WS_EX_LAYOUTRTL 0x400000
#DEFINE WS_EX_NOINHERITLAYOUT 0x100000

*-- Define the Get window long API
DECLARE INTEGER GetWindowLong IN user32;
INTEGER hWnd, INTEGER nIndex

*-- Define the Set window long API
DECLARE INTEGER SetWindowLong IN user32;
INTEGER hWnd, INTEGER nIndex, INTEGER dwNewLong

*-- Get this form's current style.
OldLong = GetWindowLong(_vfp.HWnd, GWL_EXSTYLE)


*-- Set the window extended style RTL non-inheritable.
SetWindowLong(_vfp.HWnd,GWL_EXSTYLE,BITOR(OldLong,WS_EX_LAYOUTRTL,WS_EX_NOINHERITLAYOUT))
local cr
cr=chr(13)+chr(10)
messagebox("See the vfp menu  and window.....there are Right to Left ! "+cr+"(NB : for a form use form.hwnd instead _vfp.hwnd)"+cr+" wait 5 seconds to return to old style",0+32) 

inkey(5)
SetWindowLong(_vfp.HWnd,GWL_EXSTYLE,BITOR(OldLong,WS_EX_NOINHERITLAYOUT))
messagebox("Old style restored",0+32)


Regards
Yousfi Benameur

ENTIRE THREAD

Alignment of the menu Posted by Anwar Nourel @ 6/23/2011 8:18:17 PM
RE: Alignment of the menu Posted by Mike Gagnon @ 6/23/2011 9:59:14 PM
RE: Alignment of the menu Posted by Yousfi Benameur @ 6/23/2011 10:06:58 PM