954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Receiving vscroll events from a richedit control

I am trying to catch EN_VSCROLL (vertical scroll) messages from a richedit control.
So far I have done the following:

In the form's oncreate:

int mask = SendMessage(richedit->Handle, EM_GETEVENTMASK, 0, 0);
SendMessage(richedit->Handle, EM_SETEVENTMASK, 0, mask + ENM_SCROLL);
Application->OnMessage = AppMessage;


My onmessage function is:

void form::AppMessage(tagMsg &Msg, bool &Handled)
{
  Handled = false;
  if ((Msg.message == WM_COMMAND) && (Msg.wParam == EN_VSCROLL))
  {
    // do something useful
    Handled = true;
  }
}


But nothing happens, i.e. the EN_VSCROLL message doesn't appear. From what I've seen via Google this is all I need to do, so why isn't it happening? Is it because I'm using OnMessage? I'm using Borland C++ Builder version 4 on Windows 98 which I know are both ancient, but they are reliable.

stinkypete
Newbie Poster
10 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: