I call it directly in the OnCreate function of my window ( CMDIChildWnd). At the same place I call MoveWindow to resize it and it work.