Index: src/winhugs/DlgMain.c =================================================================== RCS file: /cvs/hugs98/src/winhugs/DlgMain.c,v retrieving revision 1.4 diff -u -r1.4 DlgMain.c --- src/winhugs/DlgMain.c 6 Sep 2005 09:36:10 -0000 1.4 +++ src/winhugs/DlgMain.c 7 Sep 2005 11:13:56 -0000 @@ -467,6 +361,23 @@ FireCommand(Command); } +void ShowContextMenu(int x, int y) +{ + HMENU hEdit = GetSubMenu(GetMenu(hThisWindow), 1); + + if (x == 0xffff && y == 0xffff) + { + RECT rc; + GetWindowRect(GetDlgItem(hThisWindow, ID_RTF), &rc); + x = rc.left+2; + y = rc.top+2; + } + + TrackPopupMenu(hEdit, 0, x, y, 0, hThisWindow, NULL); + CreatePopupMenu(); + +} + INT_PTR CALLBACK MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { @@ -502,6 +413,15 @@ RtfWindowTimer();; break; + case WM_CONTEXTMENU: + { + HWND hParam = (HWND) wParam; + HWND hRtfChild = GetDlgItem(hWnd, ID_RTF); + if (hParam == hWnd || hParam == hRtfChild) + ShowContextMenu(LOWORD(lParam), HIWORD(lParam)); + } + break; + case WM_HELP: MainCommand(hWnd, ID_HELPCONTENTS); break;