Board index » delphi » WM_VSCROLL Bug Under Delphi 2.0/NT 3.51?

WM_VSCROLL Bug Under Delphi 2.0/NT 3.51?

Hi,

Under Delphi 1.0 I'm able to synchronize the vertical scrolling of two
(or more) TMemo components by creating a new memo component with an
OnVertScroll event.  I then send scroll messages to the other memo
components when I that event is triggered.  It works great under Delphi
1.0.

Unfortunately, under 2.0 it doesn't work for any scroll events that
require ScrollPos (such as dragging the thumb track).  Instead, the other
memos receive a scroll message with a ScrollPos of zero (0).

It works for scrolling using the arrows on the memo's scrollbars.  The
message is getting through, it's just that ScrollPos is being set to
zero.

Below is the code I'm using to send the message to a second and
third memo after receiving an OnVertScroll event from a first memo.

Is this a bug or am I doing something wrong in the 32-bit world?

procedure TForm1.NewMemo1VertScroll(Sender: TObject;
  ScrollCode: TScrollCode; var ScrollPos: integer);
begin
  NewMemo2.Perform(WM_VSCROLL, Ord(ScrollCode), MAKELONG(ScrollPos, 0));
  NewMemo3.Perform(WM_VSCROLL, Ord(ScrollCode), MAKELONG(ScrollPos, 0));
end;

Thanks.

Chris Fassnacht

 

Re:WM_VSCROLL Bug Under Delphi 2.0/NT 3.51?


In article <316F82DF.7...@ssc.wisc.edu>, Chris Fassnacht

Quote
<cfassna...@ssc.wisc.edu> wrote:
> Is this a bug or am I doing something wrong in the 32-bit world?

In Win32, WM_VSCROLL takes the scrollcode in the wparam loword and the pos
in the wparam hiword.

Joe Snyder
j...@semaphorecorp.com

Re:WM_VSCROLL Bug Under Delphi 2.0/NT 3.51?


Quote
Chris Fassnacht wrote:

> Hi,

> Under Delphi 1.0 I'm able to synchronize the vertical scrolling of two
> (or more) TMemo components by creating a new memo component with an
> OnVertScroll event.  I then send scroll messages to the other memo
> components when I that event is triggered.  It works great under Delphi
> 1.0.

> Unfortunately, under 2.0 it doesn't work for any scroll events that
> require ScrollPos (such as dragging the thumb track).  Instead, the other
> memos receive a scroll message with a ScrollPos of zero (0).

> It works for scrolling using the arrows on the memo's scrollbars.  The
> message is getting through, it's just that ScrollPos is being set to
> zero.

> Below is the code I'm using to send the message to a second and
> third memo after receiving an OnVertScroll event from a first memo.

> Is this a bug or am I doing something wrong in the 32-bit world?

> procedure TForm1.NewMemo1VertScroll(Sender: TObject;
>   ScrollCode: TScrollCode; var ScrollPos: integer);
> begin
>   NewMemo2.Perform(WM_VSCROLL, Ord(ScrollCode), MAKELONG(ScrollPos, 0));
>   NewMemo3.Perform(WM_VSCROLL, Ord(ScrollCode), MAKELONG(ScrollPos, 0));
> end;

> Thanks.

> Chris FassnachtHi Chris

Isn't ScrollCode suppose to be a WORD. ORD under Delphi 2.0 is LONGINT.
Tony

Other Threads