-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
We currently have
public class Message
{
// ..
public object GetLParam(Type cls) => Marshal.PtrToStructure(LParam, cls);
// ..
}However, this is implemented using Marshal.PtrToStructure which has been obsoleted. I propose adding a new API that uses the un-obsoleted marshal API:
public class Message
{
// ..
public T GetLParam<T>() => Marshal.PtrToStructure<T>(LParam);
// ..
}This would avoid the need for all the casting, e.g
NativeMethods.NMHDR nmhdr = (NativeMethods.NMHDR)m.GetLParam(typeof(NativeMethods.NMHDR));Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels