In an x86 environment,
VaR wparam = (INT) msg. wparam;
Work well.
In an x64 environment,
The quick scroll wheel will overflow when msg. wparam is converted to int (wparam = 4263510016 ).
Information:
System. overflowexception not processed
Message = arithmetic operation causes overflow.
Source = mscorlib
Stacktrace:
In system. intptr. op_explicit (intptr value)
At the location of Tim. mousewheelhandler. mousewheelmessagefilter. prefiltermessage (Message & M...
Verify that wparam is intptr, msdn says
The intptr type is designed as an integer, and its size is suitable for a specific platform. That is to say, this type of instance will be 32-bit in 32-bit hardware and operating system, and 64-bit in 64-bit hardware and operating system.
Therefore, the aboveCodeIt should be:
VaR wparam = (intptr. size = 8 )? (INT) (long) msg. wparam <32> 32): (INT) msg. wparam;
Test passed.