How to minimize CAppDialog?

 

Hi all.

Following code works correctly, except last line for minimizing dialog: 

CAppDialog AppWindow;

int OnInit() {

        // Codes for dialog creation



   AppWindow.Run();

   AppWindow.Minimized(true);   // not working as expected.



   return(INIT_SUCCEEDED);

}

Trying to use Minimize() method, it returns error of protected method. How can i do this simple task?

 

The Minimize() method works in ChartEvent(). For any other purpose you'd have to create a class that inherits from CAppDialog.

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   AppWindow.ChartEvent(id,lparam,dparam,sparam);
  }