LPARAMETERS tcCaption
LOCAL lnBar, ;
lcCaption
IF PCOUNT() = 0
lcCaption = thisform.Caption
ELSE
lcCaption = tcCaption
ENDIF
*-- Remove the form's caption from the Window menu popup.
*-- We check to see if the application object
*-- exists to prevent error messages when running
*-- the form outside the project
IF TYPE('oApp') == "O"
FOR lnBar = CNTBAR("Window") TO 1 STEP -1
IF PRMBAR("Window", GETBAR("Window", lnBar)) = lcCaption
RELEASE BAR GETBAR("Window", lnBar) OF Window
EXIT
ENDIF
ENDFOR
IF CNTBAR("Window") = 0
*- now menu is empty so remove it
RELEASE POPUP window EXTENDED
RELEASE PAD window OF _MSYSMENU
ENDIF
ENDIF