IF !POPUP("Venster") *- need to define Venster menu DO menus\window.mpr ENDIF *-- Find the next available bar number IF CNTBAR("Venster") = 0 OR ; GETBAR("Venster", CNTBAR("Venster")) < 0 && At a Fox system BAR lnBar = CNTBAR("Venster") + 1 ELSE lnBar = GETBAR("Venster", CNTBAR("Venster")) + 1 ENDIF DEFINE BAR lnBar OF Venster PROMPT thisform.caption lcFormName = thisform.Name ON SELECTION BAR lnBar OF Venster ACTIVATE Window &lcFormNameAnd in the destroy of the form you can use this to remove it again
*-- 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("Venster") TO 1 STEP -1 IF PRMBAR("Venster", GETBAR("Venster", lnBar)) = lcCaption RELEASE BAR GETBAR("Venster", lnBar) OF Venster EXIT ENDIF ENDFOR IF CNTBAR("Venster") = 0 *- now menu is empty so remove it RELEASE POPUP Venster EXTENDED RELEASE PAD window OF _msysmenu ENDIF ENDIFYou may also look at theTasTrade examle for more details as João said.