如果判断某个菜单项是否存在?解决方法

如果判断某个菜单项是否存在?
自定义创建了一个菜单,里面有若干个菜单项,有时需要删除一些菜单项,有时又需要添加一些菜单项,这样又删除又添加,搞不清楚哪些菜单项已经被删除,哪些还在,所以想找一个方法判断哪些菜单项还存在的。

------解决方案--------------------
http://topic.csdn.net/u/20110831/09/91a4d830-cb1f-496c-b8fc-f4fa7c939d4b.html?22017

去下载代码
If l是否添加到窗口=.F. And This.WindowType=0 &&&And This.ShowWindow=0 AND
_Screen.pn窗口数量=_Screen.pn窗口数量+1
This.n菜单项序号=_Screen.pn窗口数量
c菜单名称=This.Caption
Define Bar _Screen.pn窗口数量 Of hw_windows_menu Prompt c菜单名称
n表单句柄=Alltrim(Cast(n表单句柄 As c(20)))
On Selection Bar _Screen.pn窗口数量 Of hw_windows_menu Do 活动菜单控制 With "&n表单句柄"
Endif
添加菜单


Local n菜单项序号,n表单句柄,loControl,lcName,lnWidth,lnJ
n表单句柄=This.HWnd
n菜单项序号=0
lnJ=0
n菜单项序号=This.n菜单项序号
If n菜单项序号>0 And Popup("hw_windows_menu")=.T.
Release Bar n菜单项序号 Of hw_windows_menu
If _Screen.FormCount=4
Release Bar 999 Of hw_windows_menu
Endif
Endif
删除菜单
完整的代码 请在 帖子里面下载