现在的例子是Form_Onlond 调用模块里的GetFaves 函数
GetFaves Me 传递窗口过去
动态加载菜单栏 Favorites 
单击列表收藏夹。我想现实点击按钮Command1把收藏列表在Command1下。
谢谢帮忙。例子下载:www.my1982.com/Ex.Rar我Q:23638564
Eamil:[email protected]谢谢帮忙~~解决了150分立刻给上。
不够还补。

解决方案 »

  1.   

    好了~看看 ^ ^1、在Module1里WriteINI前面添加:Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
    End TypePrivate Type POINTAPI
        x As Long
        y As Long
    End TypePrivate Declare Function TrackPopupMenu& Lib "user32" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal x As Long, ByVal y As Long, ByVal nReserved As Long, ByVal hwnd As Long, lprc As RECT)
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongDim hPopMenu As Long
    Dim hForm As LongPublic Sub PopFavs()
        Dim tPos As POINTAPI
        Dim tRect As RECT
        
        GetCursorPos tPos    If hPopMenu <> 0 Then TrackPopupMenu hPopMenu, 0, tPos.x, tPos.y, 0, hForm, tRect
    End Sub
    2、在GetFaves里最后面添加:    hPopMenu = lngNewMenu
        hForm = mForm.hwnd3、在Form1里面添加:Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
        If Button = vbRightButton Then
            PopFavs
        End If
    End Sub