VB声明 
Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long 
说明 
在指定的菜单里添加一个菜单项 
返回值 
Long,非零表示成功,零表示失败。会设置GetLastError 
参数表 
参数 类型及说明 
hMenu Long,菜单句柄 
wFlags Long,参考ModifyMenu函数中的菜单常数标志定义表,其中列出了允许使用的所有常数 
wIDNewItem Long,指定菜单条目的新命令ID。如果在wFlags参数中指定了MF_POPUP字段,那么这应该是指向一个弹出式菜单的句柄 
lpNewItem String(相应的vb声明见注解),如果在wFlags参数中指定了MF_STRING标志,这就代表在菜单中设置的字串。如设置了MF_BITMAP标志,这就代表一个Long型变量,其中包含了一个位图句柄。如设置了MF_OWNERDRAW,这个值就会包括在DRAWITEMSTRUCT和MEASUREITEMSTRUCT结构中,在条目需要重画的时候由windows发送出去 
注解 
Declare Function AppendMenu& Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String)
 

解决方案 »

  1.   

    GetSubMenu 在MSDN中这样说的:
    The RemoveMenu function deletes a menu item or detaches a submenu from the specified menu. If the menu item opens a drop-down menu or submenu, RemoveMenu does not destroy the menu or its handle, allowing the menu to be reused. Before this function is called, the GetSubMenu function should retrieve a handle to the drop-down menu or submenu.
      

  2.   

    已经找到答案了,只要GetSystemMenu(Me.Hwnd,True)就行了。
    谢谢大家帮助。