Live Chat Icon For mobile
Live Chat Icon

I need to encode the LParam argument of a mouse message. How do I do MakeLong , HiWord and LoWord type conversions

Platform: WinForms| Category: from MFC

You can create static methods that encode and decode these values. Here are some.

static int MakeLong(int LoWord, int HiWord)
{
	return (HiWord << 16) | (LoWord & 0xffff);
}
static IntPtr MakeLParam(int LoWord, int HiWord)
{
	return (IntPtr) ((HiWord << 16) | (LoWord & 0xffff));
}
static int HiWord(int Number)
{
	return (Number >> 16) & 0xffff;
}
static int LoWord(int Number)
{
	return Number & 0xffff;
}

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.