🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3868

Re: WM_MOUSEMOVE and OnMouseMove

#3868
From: Bob Gonder
Date: Sun, 23 Apr 2006 16:49
19 lines
1629 bytes
JD wrote:

>I was getting some strange behavior when processing WM_MOUSEMOVE
>and traced it back to how I was interpreting X,Y. The points
>are passed in the message as words:
>
>          HeaderMouseMove( KeysToShiftState(Message.WParam), LOWORD(Message.LParam), HIWORD(Message.LParam) );
>
>and then interpreted as ints in the handler:
>
>    void __fastcall TMyListView::HeaderMouseMove( TShiftState Shift, int X, int Y );
>
>The problem was that negative numbers in a WORD just become
>large number in the ints and I'm looking for an eligant way
>of not loosing the sign.

Convert to shorts:
	MAKEPOINTS( Message.LParam ).x
	MAKEPOINTS( Message.LParam ).y
Technical Details
Message-ID: <sqbn42tbb8g362frcp784ghpeo7907h21r@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <444b800f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,526c370a5f30e5cc
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: WM_MOUSEMOVE and OnMouseMove
Date: Sun, 23 Apr 2006 09:49:17 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <sqbn42tbb8g362frcp784ghpeo7907h21r@4ax.com>
References: <444b800f$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.146.52
X-Trace: newsgroups.borland.com 1145810955 67.77.146.52 (23 Apr 2006 09:49:15 -0700)
Lines: 22
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail