Mega Code Archive

 
Categories / Delphi / Strings
 

How can i make my delphi application respond to windows messages

Using WM_WININICHANGED as an example, Chuck Jazdzewski <cjaz@borland.com> says: Declaring a method in a TForm will allow you to handle WM_WININICHANGED messages: procedure WMWinIniChange(var Message: TMessage); message WM_WININICHANGE; The body of the implementation could look like: procedure TForm1.WMWinIniChange(var Message: TMessage); begin inherited; {.. react to someone mucking with control panel ..} end; The call to "inherited" is important. Note also that message handlers are special when calling their inherited since you don't refer to the name of the inherited. This is because the inherited is referring to the inherited message handler for this message number, which might not have a visible name or or even the same name as you have given it, or in some cases, might not even exist (in which case you are really calling DefaultHandler).