It is readonly at runtime, you can only set ShowWindow at design time, that means you can't first create a form with CREATEOBJECT("form") which by default has 0 (in screen) and then want it to be a top level form. It is already created in the screen in line 1 of the code. The moment the form is created it's running, doesn't matter that it's not yet shown. At runtime you can't set this property.
So design a class of a form and create that with CREATEOBJECT() or design an scx form and run that with DO FORM
I see a lot of code like this, not only with forms, but especially with the cursoradapter baseclass, creating a baseclass and then setting properties. Design a class with the desired property values, not only when they are readonly at runtime, it's just completely broken to do that, you want a form with certain settings, think of how you can make this a class that's reusable in multiple places. If you want some properties set dynamically with values you only know at runtime and close before you create your class, that's not a problem, you have multiple ways to let this be dynamic, by using an expression in the property that get's evaluated when a class is created or by adding parameters to init which sets them. Of course that's not possible with such properties as ShowWindow. But you spare a lot of code by doing this and not repeatedly create the native base class and set its properties.
What you want is a report preview form. For a good example of how to do this, you could look into the source code of FoxyPreviewer:
View attachment 1395
They made a general frxpreviewform that is based on an frxbaseform. The major point is: To have control about ShowWindow they derived three subclasses ...astopform ..indesktop and ..inscreen from the class frxpreviewform. They mainly differ from their parent class in the ShowWindow property. So that way you can have one central class design that you manage and change and adapt when necessary and derive three subclasses with all possible ShowWindow settings and can still decide at runtime, which ShowWindow mode you want, by choosing one of the three subclasses.