'How to show icon always in taskbar when there is no visible form available

I have a systray application without any taskbar icon. Nowdays most systray icons are hidden and I want to make an easier access to app.

There are no forms created with Application.FormCreate so Delphi cannot show icon itself.

How to show a normal app icon always on taskbar even when there is no visible form available?

I want to catch the click like this and when its clicked show the GUI with my custom function:

class procedure TTrayMain.HandleMessages(var Msg: TMsg; var Handled: Boolean);
begin

   if (Msg.wparam = SC_RESTORE ) then begin 
                 MenuPopup (popup,2);
                 Exit;
                 end;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source