您需要对编辑框进行子类化并将消息截获到编辑框本身。这是 MSDN 上关于子类化控件的文章。
编辑:一些代码来演示启用按钮的滚动条:
#include <windows.h>
#include <richedit.h>
LRESULT __stdcall RichEditSubclass
(
  HWND window,
  UINT message,
  WPARAM w_param,
  LPARAM l_param
)
{
  HWND
    parent = reinterpret_cast <HWND> (GetWindowLong (window, GWL_HWNDPARENT));
  WNDPROC
    proc = reinterpret_cast <WNDPROC> (GetWindowLong (parent, GWL_USERDATA));
  switch (message)
  {
  case WM_VSCROLL:
    {
      SCROLLINFO
        scroll_info = 
        {
          sizeof scroll_info,
          SIF_ALL
        };
      GetScrollInfo (window, SB_VERT, &scroll_info);
      if (scroll_info.nPos + static_cast <int> (scroll_info.nPage) >= scroll_info.nMax ||
          scroll_info.nTrackPos + static_cast <int> (scroll_info.nPage) >= scroll_info.nMax)
      {
        HWND
          button = reinterpret_cast <HWND> (GetWindowLong (parent, 0));
        EnableWindow (button, TRUE);
      }
    }
    break;
  }
  return CallWindowProc (proc, window, message, w_param, l_param);
}
LRESULT __stdcall ApplicationWindowProc
(
  HWND window,
  UINT message,
  WPARAM w_param,
  LPARAM l_param
)
{
  bool
    use_default_proc = false;
  LRESULT
    result = 0;
  switch (message)
  {
  case WM_CREATE:
    {
      CREATESTRUCT
        *creation_data = reinterpret_cast <CREATESTRUCT *> (l_param);
      RECT
        client;
      GetClientRect (window, &client);
      HWND
        child = CreateWindow (RICHEDIT_CLASS,
                              TEXT ("The\nQuick\nBrown\nFox\nJumped\nOver\nThe\nLazy\nDog\nThe\nQuick\nBrown\nFox\nJumped\nOver\nThe\nLazy\nDog"),
                              WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL | ES_DISABLENOSCROLL,
                              0, 0, client.right, client.bottom - 30,
                              window,
                              0,
                              creation_data->hInstance,
                              0);
      SetWindowLong (window, GWL_USERDATA, GetWindowLong (child, GWL_WNDPROC));
      SetWindowLong (child, GWL_WNDPROC, reinterpret_cast <LONG> (RichEditSubclass));
      SetWindowLong (child, GWL_ID, 0);
      child = CreateWindow (TEXT ("BUTTON"), TEXT ("Go Ahead!"), WS_CHILD | WS_VISIBLE | WS_DISABLED, 0, client.bottom - 30, client.right, 30, window, 0, creation_data->hInstance, 0);
      SetWindowLong (window, 0, reinterpret_cast <LONG> (child));
      SetWindowLong (child, GWL_ID, 1);
    }
    break;
  case WM_COMMAND:
    if (HIWORD (w_param) == BN_CLICKED && LOWORD (w_param) == 1)
    {
      DestroyWindow (window);
    }
    break;
  default:
    use_default_proc = true;
    break;
  }
  return use_default_proc ? DefWindowProc (window, message, w_param, l_param) : result;
}
int __stdcall WinMain
(
  HINSTANCE instance,
  HINSTANCE unused,
  LPSTR command_line,
  int show
)
{
  LoadLibrary (TEXT ("riched20.dll"));
  WNDCLASS
    window_class = 
    {
      0,
      ApplicationWindowProc,
      0,
      4,
      instance,
      0,
      LoadCursor (0, IDC_ARROW),
      reinterpret_cast <HBRUSH> (COLOR_BACKGROUND + 1),
      0,
      TEXT ("ApplicationWindowClass")
    };
  RegisterClass (&window_class);
  HWND
    window = CreateWindow (TEXT ("ApplicationWindowClass"),
                           TEXT ("Application"),
                           WS_VISIBLE | WS_OVERLAPPED | WS_SYSMENU,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           400, 300, 0, 0,
                           instance,
                           0);
  MSG
    message;
  int
    success;
  while (success = GetMessage (&message, window, 0, 0))
  { 
    if (success == -1)
    {
      break;
    }
    else
    {
      TranslateMessage (&message);
      DispatchMessage (&message);
    }
  }
  return 0;
}
以上不处理用户在编辑框中移动光标。