I’m looking at a cursor control class that I’m trying to adapt for my program. I have it working as I wish, but I was unsure a little on what these numbers mean in this case. Can anybody shed any light on what the 0x01 etc mean.
private const int MouseEventMove = 0x01;
private const int MouseEventLeftDown = 0x02;
private const int MouseEventLeftUp = 0x04;
private const int MouseEventRightDown = 0x08;
private const int MouseEventRightUp = 0x10;
private const int MouseEventAbsolute = 0x8000;
Thanks.
These are Flag enumerations.
They are each given a value in powers of 2, so for any combined value, there will be no ambiguity about which of the flags are set.
From MSDN:
http://msdn.microsoft.com/en-us/library/ms229062.aspx
In your particular case it seems that the enumeration describes what type of mouse event is occurring.
Edit: As Hans points out, this is not technically an enumeration, but a group of
const intdefinitions, though for all practical purposes I feel it serves as an enumeration – giving a human readable label for an integral value. Is there a more suitable name for this?