RE: extracting mouse coordinate
From: Alex K (AlexK_at_discussions.microsoft.com)
Date: 10/07/04
- Next message: cwineman: "Re: much confusion about forms"
- Previous message: Iain Mcleod: "Re: How do I make the enter key act like a button click?"
- In reply to: Paul: "RE: extracting mouse coordinate"
- Next in thread: Bob Powell [MVP]: "Re: extracting mouse coordinate"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 7 Oct 2004 14:51:03 -0700
Opps sorry - lol - not enough sleep.
"Paul" wrote:
> Cool!
>
> Btw, what you meant was AND bit operation, right? So, the first short is
> always Y coordinate and second short is always X coordinate, correct?
>
> -P
>
>
> "Alex K" wrote:
>
> > I'll give this a try...
> >
> > The lparam of the message is an int which is 32bits. The x and y are stored
> > as short which is 16bits. Because the API was limited to how many parameters
> > are being passed you can the two short glued together when you get them.
> >
> > What the code does is this:
> > - using the OR logic it removes the first short and leaves you with the
> > second short that you can use.
> > - the second one works almost the same way. it removes the second short
> > leaving the first short. however the result is that the useful bits are in
> > the higher part of the int so you have to shift them down and then convert it
> > to a short.
>
- Next message: cwineman: "Re: much confusion about forms"
- Previous message: Iain Mcleod: "Re: How do I make the enter key act like a button click?"
- In reply to: Paul: "RE: extracting mouse coordinate"
- Next in thread: Bob Powell [MVP]: "Re: extracting mouse coordinate"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|