CPanelDialog - start minimized shows wrong restore icon (top right)?

 

Hi,

I have an input parameter in my EA 'startMinimized' - if the user sets it to true the dialog should be started minimized.
So I do it this way in my code:

   ExtDialog = new CPanelDialog;
   
   if (startMinimized) {
      ExtDialog.Minimized(true);
   }

   if (!ExtDialog.Create(0, "  " + _Symbol, 0, 0, 0, 232, 540))
      return (INIT_FAILED);

   //--- starting the application
   if (!ExtDialog.Run())
      return (INIT_FAILED);

   ExtDialog.OnInit();

It works - the dialog panel is started minimized but it shows the minize icon (Turn.bmp) and not the restore icon (Restore.bmp) which should be there.
This way the user has to click that icon 2x to be able to maximize it. see gif animation attached

(After it was maximized with 2 clicks instead of 1 it works as expected with one click to mini-/maximize)