riched20: WM_CONTEXTMENU fix for custom context menus.
This commit is contained in:
parent
0134e8f7d0
commit
0ad5638bf1
|
@ -1077,13 +1077,13 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
|
||||
static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
|
||||
{
|
||||
CHARRANGE selrange;
|
||||
HMENU menu;
|
||||
int seltype = 0;
|
||||
if(!editor->lpOleCallback)
|
||||
return;
|
||||
return FALSE;
|
||||
ME_GetSelection(editor, (int *)&selrange.cpMin, (int *)&selrange.cpMax);
|
||||
if(selrange.cpMin == selrange.cpMax)
|
||||
seltype |= SEL_EMPTY;
|
||||
|
@ -1099,6 +1099,7 @@ static void ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
|
|||
TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, GetParent(editor->hWnd), NULL);
|
||||
DestroyMenu(menu);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ME_TextEditor *ME_MakeEditor(HWND hWnd) {
|
||||
|
@ -2335,7 +2336,8 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
|||
ME_SelectWord(editor);
|
||||
break;
|
||||
case WM_CONTEXTMENU:
|
||||
ME_ShowContextMenu(editor, (short)LOWORD(lParam), (short)HIWORD(lParam));
|
||||
if (!ME_ShowContextMenu(editor, (short)LOWORD(lParam), (short)HIWORD(lParam)))
|
||||
goto do_default;
|
||||
break;
|
||||
case WM_PAINT:
|
||||
if (editor->bRedraw)
|
||||
|
|
Loading…
Reference in New Issue