Article View: borland.public.cppbuilder.nativeapi
Article #3867WM_MOUSEMOVE and OnMouseMove
From: JD
Date: Sun, 23 Apr 2006 13:24
Date: Sun, 23 Apr 2006 13:24
19 lines
1444 bytes
1444 bytes
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:
if( Message.Msg == WM_MOUSEMOVE )
{
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.
~ JD
Technical Details
Message-ID:
<444b800f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,526c370a5f30e5cc,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "JD" <nospam@nospam.com> Sender: "JD" <nospam@nospam.com> Reply-To: "JD" <nospam@nospam.com> Subject: WM_MOUSEMOVE and OnMouseMove Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 152.163.100.201 X-Forwarded-For: 172.145.15.234 NNTP-Posting-Host: 207.105.83.66 Message-ID: <444b800f$1@newsgroups.borland.com> Date: 23 Apr 2006 06:24:31 -0700 X-Trace: newsgroups.borland.com 1145798671 207.105.83.66 (23 Apr 2006 06:24:31 -0700) Lines: 20 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail