excelthoughts
Programmer
Hi,
I am porting some code to C# from Delphi.
The Delphi code makes use of custom messages. One such message has a struct setup of:
// For UM_FLASH message
public struct TUMFlash
{
public uint Msg;
public bool MakeFlashing;
public bool LeftClick;
public bool RightClick;
public bool Unused;
public Object FlashObject;
public int Result;
}
Delphi usage:
Msg.LeftClick = true;
Msg.MakeFlashing = true;
Msg.LParam = 0;
Msg.FlashObject= SomeObject;
PostMessage(SomeHandle, SomeInt,TMessage(Msg).WParam, TMessage(Msg).LParam);
Delphi allows the user to send whatever they like into the Windows message (bool, object etc). Can this be done in .NET? i.e. overriding the Windows message (struct shown below)
public struct Message
{
...
public IntPtr HWnd { get; set; }
public IntPtr LParam { get; set; }
public int Msg { get; set; }
public IntPtr Result { get; set; }
public IntPtr WParam { get; set; }
...
}
If not, how does one associate other data with a Windows message in .NET?
Regards
Andrew
I am porting some code to C# from Delphi.
The Delphi code makes use of custom messages. One such message has a struct setup of:
// For UM_FLASH message
public struct TUMFlash
{
public uint Msg;
public bool MakeFlashing;
public bool LeftClick;
public bool RightClick;
public bool Unused;
public Object FlashObject;
public int Result;
}
Delphi usage:
Msg.LeftClick = true;
Msg.MakeFlashing = true;
Msg.LParam = 0;
Msg.FlashObject= SomeObject;
PostMessage(SomeHandle, SomeInt,TMessage(Msg).WParam, TMessage(Msg).LParam);
Delphi allows the user to send whatever they like into the Windows message (bool, object etc). Can this be done in .NET? i.e. overriding the Windows message (struct shown below)
public struct Message
{
...
public IntPtr HWnd { get; set; }
public IntPtr LParam { get; set; }
public int Msg { get; set; }
public IntPtr Result { get; set; }
public IntPtr WParam { get; set; }
...
}
If not, how does one associate other data with a Windows message in .NET?
Regards
Andrew