Code completion does not display message handlers

When working on an old project in Delphi XE2, the code completion window that appears after CTRL - SPACE does not display message handlers such as Delphi 7:

Screen shot

There are no WM*** procedures in the above screenshot. Why is this?

+4
source share
1 answer

The module names in the uses clause are not fully qualified. Include a namespace for each device, and then find the types you need for method declarations so that all members are returned in the code completion pop-up window.

For instance:

  • procedure WMActivate(var Message: TWMActivate); will not be displayed if Winapi.Messages.TWMActivate not found,
  • procedure CMActivate(var Message: TCMActivate); will not be displayed if Vcl.Controls.TCMActivate not found.

Decision:

 uses Winapi.Windows, Winapi.Messages, System.Classes, Vcl.Controls, Vcl.Forms, Vcl.Graphics; 

enter image description here

That is why I dare not explain. Moreover, all other methods (which are not message handlers) show whether the corresponding unit is fully consistent or not. But it does not really matter; when working in Delphi 2009 or higher, you should get used to using fully qualified host names.

+10
source

Source: https://habr.com/ru/post/1481666/


All Articles