W WAITLONG Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-13 #1 请问一下各位高手,能不能禁止一个可执行文件的菜单呢? 比如禁止“记事本”的“文件”菜单。
L liyinwei Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-14 #5 var H: THandle; mH: HMenu; ...... H := FindWindow(nil, '无标题 - 记事本'); if H <> 0 then begin mH := Windows.GetMenu(H); RemoveMenu(mH,0,MF_BYPOSITION); //删除文件菜单 end;
var H: THandle; mH: HMenu; ...... H := FindWindow(nil, '无标题 - 记事本'); if H <> 0 then begin mH := Windows.GetMenu(H); RemoveMenu(mH,0,MF_BYPOSITION); //删除文件菜单 end;
W WAITLONG Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-14 #6 谢谢,一会就试下,行的话就加分~~~ 这对其他程序也有作用吧?
P praisesoft Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-14 #7 var HFile: HMENU; HM: HMENU; begin H := FindWindow(nil, '无标题 - 记事本'); if H <> 0 then HM := GetMenu(H); HFile := Windows.GetSubMenu( HM, 0); if HFile <> 0 then begin WIndows.EnableMenuItem(HM, HFile, MF_GRAYED or MF_DISABLED) end;
var HFile: HMENU; HM: HMENU; begin H := FindWindow(nil, '无标题 - 记事本'); if H <> 0 then HM := GetMenu(H); HFile := Windows.GetSubMenu( HM, 0); if HFile <> 0 then begin WIndows.EnableMenuItem(HM, HFile, MF_GRAYED or MF_DISABLED) end;
W WAITLONG Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-14 #8 它对记事本有用,为什么对于Apabi Reader 2.0,WORD等无效呢?它们难道不一样吗?
W WAITLONG Unregistered / Unconfirmed GUEST, unregistred user! 2006-02-14 #9 我知道了,Apabi Reader2.0的菜单不是一个Hmenu 对象,所以无法用上述方法删除或禁止,但还有没有其它办法禁止或删除它呢?有的话再追加100分~~~~