真悲催,网络方法大把,就是没个好用,如何禁止右键!!!
如果禁止鼠标右键啊?因为我软件里面有一个播放器,不想用户右键查看属性什么的。
请高手说详细点方法,我网上找了很多,没一个有效。。。
[解决办法]
随便找个子类化代码都行吧,你确定你找对了方法?
下载这个:
单类模块子类化,无崩溃版,作者为PctGL(VB6.0)
http://blog.m5home.com/article.asp?id=487
在窗体上添加个文本框,再把窗体代码改为下面的内容,然后在文本框里点右键看看.
Option ExplicitDim WithEvents m As iSubClassPrivate Const WM_RBUTTONDOWN As Long = &H204Private Const WM_RBUTTONUP As Long = &H205Private Sub Form_Load() Set m = New iSubClass m.SetMsgHook Text1.hWndEnd SubPrivate Sub m_GetWindowMessage(Result As Long, ByVal cHwnd As Long, ByVal Message As Long, ByVal wParam As Long, ByVal lParam As Long) Select Case Message Case WM_RBUTTONDOWN, WM_RBUTTONUP Result = -1 Case Else Result = m.CallDefaultWindowProc(cHwnd, Message, wParam, lParam) End SelectEnd Sub