RE: extracting mouse coordinate

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alex K (AlexK_at_discussions.microsoft.com)
Date: 10/07/04


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.
>



Relevant Pages

  • Re: Pipe show info?
    ... > Thanks, Joe. ... BTW, don't you ever sleep? ... LOL. ...
    (alt.smokers.pipes)
  • Re: Bates Method Comic Relief
    ... btw i don't really sleep ... i just look at the sun instead ... LOL ...
    (sci.med.vision)
  • Re: A gooood couple weeks.
    ... LOL! ... Sleep whenever you can. ... to do WORSE in your classes AND with your Fibro in general. ... the school overload or volunteering. ...
    (alt.med.fibromyalgia)
  • Re: A gooood couple weeks.
    ... I do totally understand your sleep pattern, I'm on the same one, ... LOL! ... to do WORSE in your classes AND with your Fibro in general. ... the school overload or volunteering. ...
    (alt.med.fibromyalgia)