[API]
InsertMenuA
InsertMenuW
CreatePopupMenu

[INCLUDE]
LoadResEx_Menu

[CODE]
Public Function LoadResEx_Menu_MakePopupMenu(ByRef hMenu As Long, Optional ByVal KeepAnyWay As Boolean = False) As Long
  If Not hMenu = 0& Then
    LoadResEx_Menu_MakePopupMenu = CreatePopupMenu()
    If LoadResEx_Menu_MakePopupMenu = 0& Then
      If Not KeepAnyWay Then
        DestroyMenu hMenu
        hMenu = 0&
        End If
      ElseIf IsUnicode Then
      Call InsertMenuW(LoadResEx_Menu_MakePopupMenu, -1&, &H410&, hMenu, ByVal 0&)
      Else
      Call InsertMenuA(LoadResEx_Menu_MakePopupMenu, -1&, &H410&, hMenu, ByVal 0&)
      End If
    End If
  End Function
