Re: Bitwise operating...is that the term?
- From: "Boo K.M." <khanming@xxxxxxxxxxxxx>
- Date: Wed, 3 Aug 2005 11:05:05 +0800
Some advice,
if both values if 16-bit, say, you can always mask it with AND operator with
number (better work with hexadecimal) - &H8xxx
That make sure the the number output always negative.
(Correct me if I am wrong)
If you want invert the lParam somehow, when pos-, change to neg-, and vice
versa, then use XOR operator.
Again, with that magic number(huh?) - &H8xxx
0 XOR 1 = 1
1 XOR 1 = 0
(the right operand is the &H8xxxx - '8' - 1000)
Also, it is confusing if put bitwise 'operating', I prefer, I think to many
peoples wish as well - bitwise arithmetic will be much better.
"YYZ" <matt@xxxxxxxxx> wrote in message
news:1123034811.225826.160030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> There is an addin for VB6 that makes the mousewheel work in the IDE,
> and it works great, unless you have multiple monitors and have them
> setup in a certain configuration (in my case, 3, with the one on the
> far right being the primary monitor).
>
> The code in the subclassed WindowProc function is incorrectly finding
> the position of the X coordinate of the mouse. It is finding the X
> coordinate of the mouse by taking lParam and ANDing it with 65535 --
> lParam AND 65535, oddly enough.
>
> Now, if the real x coordinate is negative (say, -200), then lParam AND
> 65535 returns a very large number, something along the lines of 64992,
> I believe (sorry I don't have exact numbers because I can't post from
> work, and I don'thave the multiple monitors at home.)
>
> So, if lparam is 19660186, what would I AND with that to find a low
> negative number? How would I make it return the correct X coordinates
> for positive and negative numbers?
>
> Oh -- the reason it needs the X and Y coords of the mouse is because it
> needs to find the window handle of the window under the mouse to send
> the scroll message -- pthWnd = WindowFromPointXY(XPos, YPos)
>
> Thanks for any advice anyone has out there.
>
> Matt
>
.
- References:
- Bitwise operating...is that the term?
- From: YYZ
- Bitwise operating...is that the term?
- Prev by Date: Re: Oracle 9.2 connection
- Next by Date: Re: Oracle 9.2 connection
- Previous by thread: Re: Bitwise operating...is that the term?
- Next by thread: Re: Bitwise operating...is that the term?
- Index(es):
Relevant Pages
|