Jul 012018

You might have become used to it, but probably every Delphi developer has at one time wondered why the Messages window is still visible (and takes up valuable screen real estate) even if it is empty. And even worse, if you close it manually, it automatically comes back when you compile your project.

I too, had become used to it, but got reminded of this nuisance by a recent post from Graeme Geldenhuys on Google+:

How to auto close Message View window on successful compilation.
This was asked for in Delphi 7, but it seems with Delphi XE3 (what I’m using) it’s still not possible. Anybody know of a 3rd party add-in or hidden Delphi setting that will close the Message View after a successful compilation?

If I save my “desktop environment” while the Message View window is closed, then compile it doesn’t display the Message View – if no errors occurred. If a error occurs, then the Message View automatically appears. After I fixed the compilation error and recompile, the Message View stays there and doesn’t close. At this point I want it to close automatically. It is so damn annoying. I need all the screen (editor) space I can get, and the always visible Message View is taking up vital space.

Any known solution for this? Once again, Lazarus IDE does this perfectly.

As far as I know, there is no solution, neither in the Delphi IDE itself nor in any plugin I am aware of. (Update: There actually is one) Until today that is: I have just committed a change to the GExperts repository with the following description:

new IDE enhancement: Automatically close message window (if no errors, warnings or hints)

It is, like most IDE enhancements in GExperts, a hack. It works by hooking the Progress window and when it closes, checks whether there were any hints, warnings or errors. If there are none, it starts a timer that will wait for 1000 ms and then search and close the Messages window.

It works for me, your mileage may vary, of course. If you want to test it, for now you have to compile your own GExperts DLL. Don’t forget to actually enable that option on the IDE page of the configuration dialog!