winapi - OnNotifyMessage vs .NET event model -
does subclassing .net winforms controls custom onnotifymessage procedure have advantage compared regular .net event handlers, besides capturing additional information? compiler generate better, faster code using either technique?
it substitute overriding wndproc() method. "advantage" onnotifymessage() cannot alter message wndproc() can. note signatures of both methods, wndproc passes ref message msg, onnotifymessage doesn't use ref. wndproc has cas demand securitypermissionflag.unmanagedcode, onnotifymessage() doesn't.
i never once found reason favor onnotifymessage on wndproc. not uncommon override wndproc because want alter message. using cas in winforms app pretty unusual, run in full trust. , stopped mattering in .net 4 cas deprecated.
Comments
Post a Comment