This is working Ok when Rhinoceros Window is not minized, but My applicattion always works minimzed and when it is working minimized, the image is not rendered, it is Wireframe.
My guess is that your geometry does not have render meshes. That is, in order for surface and polysurface objects to render, they need render meshes.
When you add a new surface or polysurface, and Rhino has one of its viewport set to either Shaded or Rendered display, then when the display is redrawn, Rhino will automatically generate a render mesh for the new object. This is why you see the Creating meshes... Press Esc to cancel message when running surfacing commands.
When Rhino is minimized, it knows it does not have to redraw its viewports (because it is hidden). Thus when new objects are added, render meshes are not automatically generated.
Since you are scripting command, you can force Rhino to generate render meshes simply by scripting the BoundingBox command, which uses render meshes to calculate the tight bounding box of surfaces and polysurfaces.