>>>>Hi,
>>>>
>>>>I have the following code in my application that creates a window in which a report is previewed. Here is the code:
>>>>
>>>>DEFINE WINDOW RepWindow ;
>>>> FROM 1, 1 TO 20, 20 ;
>>>> TITLE cReportTitle SYSTEM
>>>>
>>>>ZOOM Window RepWindow Max
>>>>
>>>>WAIT CLEAR
>>>>
>>>>REPORT FORM (cReportFrxName) TO PRINTER PROMPT PREVIEW WINDOW RepWindow
>>>>
>>>>RELEASE WINDOW RepWindow
>>>>
>>>>
>>>>While user is previewing the report (at the line REPORT FORM above), a code in another place of the application scans all open windows, as such:
>>>>
>>>>lnForms = _screen.formcount
>>>>
>>>>FOR i = lnForms to 1 STEP -1
>>>>
>>>> *-- try to release this form:
>>>> _screen.Forms(i).Release
>>>>
>>>>ENDFOR
>>>>
>>>>
>>>>But the _screen.formcount does not seem to include the form created with the DEFINE WINDOW (above).
>>>>
>>>>How can I either include the form created with DEFINE WINDOW in the _screen.formcount? Or how can I check if this form created with DEFINE WINDOW exists?
>>>>
>>>>TIA
>>>
>>>Check WCHILD(), WEXISTS() and also you could release without checking with release windows.
>>
>>Thank you very much.
>
>Besides Cetins approach you might check if there is not a FormSet in which those windows defined in FPW commands exist.
I don't use FormSets in my application. Thanks.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham