On 21 October 2010 07:00, Chris Sutcliffe wrote:
> On 20 October 2010 15:24, Kana Natsuno wrote:
>> On Thu, 21 Oct 2010 02:18:08 +0900, Bram Moolenaar wrote:
>>> Patch 7.3.031
>>> Problem:    Can't pass the X window ID to another application.
>>> Solution:   Add v:windowid. (Christian J. Robinson, Lech Lorens)
>>> Files:            runtime/doc/eval.txt, src/eval.c, src/gui.c, src/vim.h,
>>>           src/os_unix.c
>>
>> We already use the term "window" to mean a viewport on a buffer.
>> So that the name "v:windowid" may lead to a misunderstanding.
>> It should be renamed "v:xwindowid" etc to express that it's not
>> related to "window" (as a viewport on a buffer), shouldn't it?
>
> What would be cool would be to v:windowid to return the gvim HWND in
> the Windows world.  At which point v:windowid would be appropriate
> across OSes.

To that end, this minor patch populates v:windowid with the gvim HWND
under windows:

$ hg diff gui_w32.c
diff -r 6c05b5e5c1be src/gui_w32.c
--- a/src/gui_w32.c     Wed Oct 20 21:23:33 2010 +0200
+++ b/src/gui_w32.c     Thu Oct 21 08:33:12 2010 -0400
@@ -1573,6 +1573,11 @@
 # endif
 #endif

+#ifdef FEAT_EVAL
+        /* Set the window ID variable */
+        set_vim_var_nr(VV_WINDOWID, s_hwnd);
+#endif
+
 theend:
     /* Display any pending error messages */
     display_errors();

Cheers!

Chris

-- 
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui