1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: MS-Windows: some characters do not show in dialogs.
12 Solution: Use the wide methods when available. (Yanwei Jia)
13 Files: src/gui_w32.c, src/gui_w48.c, src/os_mswin.c, src/os_win32.c,
17 *** ../vim-7.3.276/src/gui_w32.c 2011-08-10 15:56:24.000000000 +0200
18 --- src/gui_w32.c 2011-08-10 16:52:55.000000000 +0200
22 pGetMonitorInfo = (TGetMonitorInfo)GetProcAddress(user32_lib,
27 + /* If the OS is Windows NT, use wide functions;
28 + * this enables common dialogs input unicode from IME. */
29 + if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
31 + pDispatchMessage = DispatchMessageW;
32 + pGetMessage = GetMessageW;
33 + pIsDialogMessage = IsDialogMessageW;
34 + pPeekMessage = PeekMessageW;
38 + pDispatchMessage = DispatchMessageA;
39 + pGetMessage = GetMessageA;
40 + pIsDialogMessage = IsDialogMessageA;
41 + pPeekMessage = PeekMessageA;
47 *** ../vim-7.3.276/src/gui_w48.c 2010-10-20 21:22:17.000000000 +0200
48 --- src/gui_w48.c 2011-08-10 16:49:39.000000000 +0200
51 KillTimer(NULL, idEvent);
53 /* Eat spurious WM_TIMER messages */
54 ! while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
57 if (blink_state == BLINK_ON)
59 KillTimer(NULL, idEvent);
61 /* Eat spurious WM_TIMER messages */
62 ! while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
65 if (blink_state == BLINK_ON)
69 KillTimer(NULL, blink_timer);
70 /* Eat spurious WM_TIMER messages */
71 ! while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
77 KillTimer(NULL, blink_timer);
78 /* Eat spurious WM_TIMER messages */
79 ! while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
87 /* Eat spurious WM_TIMER messages */
88 ! while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
90 if (idEvent == s_wait_timer)
95 /* Eat spurious WM_TIMER messages */
96 ! while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
98 if (idEvent == s_wait_timer)
102 static char_u k10[] = {K_SPECIAL, 'k', ';', 0};
105 ! GetMessage(&msg, NULL, 0, 0);
108 /* Look after OLE Automation commands */
110 static char_u k10[] = {K_SPECIAL, 'k', ';', 0};
113 ! pGetMessage(&msg, NULL, 0, 0);
116 /* Look after OLE Automation commands */
120 /* Message can't be ours, forward it. Fixes problem with Ultramon
122 ! DispatchMessage(&msg);
128 /* Message can't be ours, forward it. Fixes problem with Ultramon
130 ! pDispatchMessage(&msg);
136 if (msg.message == WM_USER)
138 MyTranslateMessage(&msg);
139 ! DispatchMessage(&msg);
144 #ifdef MSWIN_FIND_REPLACE
145 /* Don't process messages used by the dialog */
146 ! if (s_findrep_hwnd != NULL && IsDialogMessage(s_findrep_hwnd, &msg))
148 HandleMouseHide(msg.message, msg.lParam);
151 if (msg.message == WM_USER)
153 MyTranslateMessage(&msg);
154 ! pDispatchMessage(&msg);
159 #ifdef MSWIN_FIND_REPLACE
160 /* Don't process messages used by the dialog */
161 ! if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg))
163 HandleMouseHide(msg.message, msg.lParam);
167 if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE,
170 ! DispatchMessage(&msg);
175 if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE,
178 ! pDispatchMessage(&msg);
186 if (!s_busy_processing)
187 ! while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
188 && !vim_is_input_buf_full())
194 if (!s_busy_processing)
195 ! while (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
196 && !vim_is_input_buf_full())
201 KillTimer(NULL, s_wait_timer);
203 /* Eat spurious WM_TIMER messages */
204 ! while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
209 KillTimer(NULL, s_wait_timer);
211 /* Eat spurious WM_TIMER messages */
212 ! while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
216 *** ../vim-7.3.276/src/os_mswin.c 2011-06-19 01:30:01.000000000 +0200
217 --- src/os_mswin.c 2011-08-10 16:45:24.000000000 +0200
223 ! while (!*bUserAbort && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
225 ! if (!hDlgPrint || !IsDialogMessage(hDlgPrint, &msg))
227 TranslateMessage(&msg);
228 ! DispatchMessage(&msg);
236 ! while (!*bUserAbort && pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
238 ! if (!hDlgPrint || !pIsDialogMessage(hDlgPrint, &msg))
240 TranslateMessage(&msg);
241 ! pDispatchMessage(&msg);
250 ! while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
252 TranslateMessage(&msg);
253 ! DispatchMessage(&msg);
261 ! while (pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
263 TranslateMessage(&msg);
264 ! pDispatchMessage(&msg);
268 *** ../vim-7.3.276/src/os_win32.c 2011-07-07 16:20:45.000000000 +0200
269 --- src/os_win32.c 2011-08-10 16:54:50.000000000 +0200
273 # define wcsicmp(a, b) wcscmpi((a), (b))
276 + /* Enable common dialogs input unicode from IME if posible. */
278 + LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage;
279 + BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage;
280 + BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage;
281 + BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage;
285 /* Win32 Console handles for input and output */
286 static HANDLE g_hConIn = INVALID_HANDLE_VALUE;
292 ! if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
294 TranslateMessage(&msg);
295 ! DispatchMessage(&msg);
297 if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
303 ! if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
305 TranslateMessage(&msg);
306 ! pDispatchMessage(&msg);
308 if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
310 *** ../vim-7.3.276/src/os_win32.h 2011-05-05 18:31:54.000000000 +0200
311 --- src/os_win32.h 2011-08-10 16:51:58.000000000 +0200
316 # define vim_mkdir(x, y) mch_mkdir(x)
319 + /* Enable common dialogs input unicode from IME if posible. */
321 + /* The variables are defined in os_win32.c. */
322 + extern LRESULT (WINAPI *pDispatchMessage)(LPMSG);
323 + extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT);
324 + extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG);
325 + extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT);
327 + # define pDispatchMessage DispatchMessage
328 + # define pGetMessage GetMessage
329 + # define pIsDialogMessage IsDialogMessage
330 + # define pPeekMessage PeekMessage
332 *** ../vim-7.3.276/src/version.c 2011-08-10 16:31:18.000000000 +0200
333 --- src/version.c 2011-08-10 17:06:55.000000000 +0200
337 { /* Add new patch number below this line */
343 Veni, Vidi, VW -- I came, I saw, I drove around in a little car.
345 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
346 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
347 \\\ an exciting new programming language -- http://www.Zimbu.org ///
348 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///