'新增菜单，并且加入文字图标
'
'例题：
'FORM1_WM_CREATE ------------------ 一般在主窗口创建时 -----------------------------------------
'  Dim ss As String = GetResourceStr("ICONFONT")
'  Dim As Long uu
'  Dim ff As Any Ptr = AddFontMemResourceEx(StrPtr(ss), Len(ss), 0, @uu)
''-------------------  设置字体，XP到WIN10的效果不同，不同设置    --------------------------
'  Dim tFont As HFONT
'  If IsVista Then
'      If AfxScaleX(1) = 1 Then
'          tFont = AfxCreateFont("ICONFONT", 12, -1)
'      Else
'          tFont = AfxCreateFont("ICONFONT", 11, -1)
'      End If
'  Else
'      tFont = AfxCreateFont("ICONFONT", 10, -1)
'  End If
''----------------  菜单设置  ---------------------------
'  yMenu1 = CreatePopupMenu()
'  AddMenuText(yMenu1, 10001,  "复制选择内容", tFont, &Hec7a,&H000000)
'  AppendMenu yMenu1, MF_SEPARATOR, 0, ""
'  AddMenuText(yMenu1, 10004,  "选择当前内存区", tFont, &He61d,&H000000)
''-------------  销毁字体  ---------------------
' DeleteObject tFont
Function AddMenuText(yMenu As HMENU,cID As ULong ,Text As String , tFont As HFONT=0, nText As Long=0 ,hColor As Long=0 ) As Long '  新增菜单，并且加入文字图标
  Function = AppendMenuA(yMenu, MF_STRING, cID, Text)
  if nText Then MenuTextOutImag(yMenu, cID, tFont, nText,hColor)

End Function