Here's code I just made which entirely emulates the menu popping up:
Code:
Option Explicit


Private Type POINTAPI
        X As Long
        Y As Long
End Type


Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type


Private Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetMenuItemRect Lib "user32" (ByVal hWnd As Long, ByVal hMenu As Long, ByVal uItem As Long, lprcItem As RECT) As Long
Private Declare Function HiliteMenuItem Lib "user32" (ByVal hWnd As Long, ByVal hMenu As Long, ByVal wIDHiliteItem As Long, ByVal wHilite As Long) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long


Private Const MF_BYPOSITION = &H400&
Private Const MF_HILITE = &H80&
Private Const MF_UNHILITE = &H0&


Private Sub Command1_Click()
    Dim hMenu As Long, RCMenu As RECT, PT As POINTAPI
    Const MenuNumber = 0 ' Should be 0 for first menu in menu bar, 1 for second, etc.
    hMenu = GetMenu(hWnd)
    Call GetMenuItemRect(hWnd, hMenu, MenuNumber, RCMenu)
    PT.X = RCMenu.Left
    Call ScreenToClient(hWnd, PT)
    Call HiliteMenuItem(hWnd, hMenu, MenuNumber, MF_BYPOSITION Or MF_HILITE)
    Call PopupMenu(Menu:=mnuFile, X:=ScaleX(PT.X, vbPixels, ScaleMode), Y:=0) ' Menu:=YourMenuName
    Call HiliteMenuItem(hWnd, hMenu, MenuNumber, MF_BYPOSITION Or MF_UNHILITE)
End Sub
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879