Win32 WM_CUT and WM_COPY

Something strange is happening. When I handle both WM_CUT and WM_COPY in my subclass edit procedure, the text I have highlighted doesn't get cut. When I click Cut in the context menu in the edit box a WM_COPY is sent first, then a WM_CUT to the subclass edit procedure. But when I handle only WM_CUT in my edit procedure everything works fine. Anybody seen this before?

This is how I'm handling these two messages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
LRESULT CALLBACK EditProc(HWND hwndEdit, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
    case WM_CUT:
           CallWindowProc(wpOrigEditProc, hwndEdit, msg, wParam, lParam);
           break;

    case WM_COPY:
          CallWindowProc(wpOrigEditProc, hwndEdit, msg, wParam, lParam);
          break;

    default:
          return CallWindowProc(wpOrigWindowProc, hwndEdit, msg, wParam, lParam);
    }
    return 0;
}
Last edited on
Topic archived. No new replies allowed.