Hi,

Some people find a widely used English to Chinese electronic dictionary can't 
grab word
from VIM under Windows, this dictionary program hooks TextOut() API family and 
sends a 
WM_PAINT to other programs to intercept text.

After digged the code I think a judgement in gui_w32.c:gui_mch_draw_string() is 
too strict
probably. In 7.0.188, gui_w32.c:gui_mch_draw_string():2252:

    /* On NT, tell the font renderer not to "help" us with Hebrew and Arabic
     * text.  This doesn't work in 9x, so we have to deal with it manually on
     * those systems. */
    if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
        foptions |= ETO_IGNORELANGUAGE;

Without this statement the dictionary works well. This is not a bug of VIM, but 
I'm afraid
it's better to test whether the window *which mouse pointer is in* has 
'rightleft' option been
set, that will do a great favour for the dictionary program and its many users.

I tried to change that statement like this:

     /* On NT, tell the font renderer not to "help" us with Hebrew and Arabic
      * text.  This doesn't work in 9x, so we have to deal with it manually on
      * those systems. */
-    if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
+    if (
+#ifdef FEAT_RIGHTLEFT
+        curwin->w_p_rl &&
+#endif
+            os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
        foptions |= ETO_IGNORELANGUAGE;

But it leads to same problem, when two windows are opened, one has 'rightleft' 
option been
set and holds the focus, then the dictionary program can't grab word in another 
window. I
need a function to get the window which the mouse pointer is above.

I admit it's a nasty hack, but it really helps a lot for many many users 
here(China:-), we will
appreciate very much if this problem can be solved.

Best regards,

Liu Yubao

Reply via email to