RE: extracting mouse coordinate
From: Paul (Paul_at_discussions.microsoft.com)
Date: 10/07/04
- Next message: Iain Mcleod: "Re: How do I make the enter key act like a button click?"
- Previous message: Lee Gillie: "Re: anchor property for button not working"
- In reply to: Alex K: "RE: extracting mouse coordinate"
- Next in thread: Alex K: "RE: extracting mouse coordinate"
- Reply: Alex K: "RE: extracting mouse coordinate"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 7 Oct 2004 14:45:01 -0700
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: Iain Mcleod: "Re: How do I make the enter key act like a button click?"
- Previous message: Lee Gillie: "Re: anchor property for button not working"
- In reply to: Alex K: "RE: extracting mouse coordinate"
- Next in thread: Alex K: "RE: extracting mouse coordinate"
- Reply: Alex K: "RE: extracting mouse coordinate"
- Messages sorted by: [ date ] [ thread ]