Dynamically Inserting a Menu Bar Item

hFrame = WinQueryWindow(hwnd,                 /* Current Window    */
                        QW_PARENT);           /* Parent            */

hMenu = WinWindowFromID(hFrame,               /* Get handle of     */
                        FID_MENU);            /* menu bar          */

MenuItem.iPosition = MIT_END;                 /* Item position     */
MenuItem.afStyle = MIS_TEXT;                  /* Item style        */
MenuItem.afAttribute = 0;                     /* No attributes     */
MenuItem.id = MI_OPENOBJECT;                  /* Item identifier   */
MenuItem.hItem = 0;                           /* No handle         */
MenuItem.hwndSubmenu = 0;                     /* No p'down handle  */

rc = WinSendDlgItemMsg(hMenu,                 /* Send message      */
                       MI_FILE,               /* to File pulldown  */
                       MM_INSERTITEM,         /* Message class     */
                       &MenuItem,             /* Pointer to item   */
                       szItemText);           /* Text of menu item */


[Back: DosWaitChild() Function]
[Next: Dynamically Inserting a Pulldown Menu]