Re: Inherited explained
- From: Hans-Peter Diettrich <DrDiettrich1@xxxxxxx>
- Date: Tue, 21 Oct 2008 17:49:11 +0200
Anonymous schrieb:
else
inherited; //inherited means to do what you would have otherwise done
end;
This is only one use of inherited, for a default handling of the call. In other situations you want to do other things, before or after calling the inherited method to do what is always required.
If the 'else inherited;' had not been placed at the end of the WMSysCommand procedure, any other sys command messages (example: SC_MINIMIZE, SC_MAXIMIZE, SC_RESTORE) would have been captured by the WMSysCommand procedure and would have simply been ignored. As a result of the presents of the inherited statement, all other sys command messages are processed as usual as if the WMSysCommand procedure were not present.
Messages should always be handled, somehow. If you handle a message entirely in your code, it's useless or harmful to pass an already handled message to another handler.
DoDi
.
- References:
- Inherited explained
- From: Anonymous
- Inherited explained
- Prev by Date: Inherited explained
- Next by Date: Re: Inherited explained
- Previous by thread: Inherited explained
- Next by thread: Re: Inherited explained
- Index(es):