riched20: fix key handling in dialogs
Clinton Stimpson
cjstimpson at utwire.net
Mon Nov 13 22:33:42 CST 2006
Fixed bug 6680. Return and control-tab keys not handled correctly when
richedit is in dialog.
Thanks,
Clint
ChangeLog:
riched20: Fix special key handling in dialogs.
-------------- next part --------------
Index: dlls/riched20/editor.c
===================================================================
RCS file: /home/wine/wine/dlls/riched20/editor.c,v
retrieving revision 1.143
diff -u -r1.143 editor.c
--- dlls/riched20/editor.c 10 Nov 2006 11:46:55 -0000 1.143
+++ dlls/riched20/editor.c 14 Nov 2006 04:16:55 -0000
@@ -1465,8 +1465,20 @@
case WM_GETDLGCODE:
{
UINT code = DLGC_WANTCHARS|DLGC_WANTARROWS;
- if (GetWindowLongW(hWnd, GWL_STYLE)&ES_WANTRETURN)
- code |= 0; /* FIXME what can we do here ? ask for messages and censor them ? */
+ if(lParam && (((LPMSG)lParam)->message == WM_KEYDOWN))
+ {
+ int vk = (int)((LPMSG)lParam)->wParam;
+ /* if style says we want return key */
+ if((vk == VK_RETURN) && (GetWindowLongW(hWnd, GWL_STYLE) & ES_WANTRETURN))
+ {
+ code |= DLGC_WANTMESSAGE;
+ }
+ /* we always handle ctrl-tab */
+ if((vk == VK_TAB) && (GetKeyState(VK_CONTROL) & 0x8000))
+ {
+ code |= DLGC_WANTMESSAGE;
+ }
+ }
return code;
}
case WM_NCCREATE:
More information about the wine-patches
mailing list